Form Field Name problem

D

Diarmuid

Hi
I have a database (db1) which I imported into a new database (db2). Now
it won't compile. Its not a references problem. The problem seems to be with
field names.
For example, I have a field called InvoicePosted. This is the source of a
check box called chkPosted. In my code I have a line with
Me.InvoicePosted = True

This works fine in db1 and actually autofills when I type Me.Inv...
In db2, when I complie I'll get "Method or data member not found". If I
rename as Me.chkPosted, all works well. Me.InvoicePosted will not auto fill.

On another form, I have a field in the table called CustomerCode. In db1,
this isn't actually bound to a text box, its not on the form. But it still
appears in autofill and I can reference it in code as Me.CustomerCode. This
won't work in db2 unless I drag the field onto the form. Should all fields
refered to in code actually be on the form?

db1 works fine. Why would the differences happen? I've seen this kind of
problem before, and never did find out the reason.

Thanks
Diarmuid
 
M

Michael Cheng [MSFT]

Hi Diarmuid,

From your descriptions, I understood that some fields in your Access Forms,
which is imported from another access file, could not be compiled
correctly. Have I understood you? If there is anything I misunderstood,
please feel free to let me know :)

Based on my test, everything turn out to be as expected and I could not
reporduce your problems on my machine
1. I make a form, which is based on a newly created table
2. I add bound and unbound text box on the form
3. Close the file and then I make a new file to import that form, only form
is imported
4. I could autofill bound and unbound text box

Which version of Access you used? Do you make it in MDB or ADP?
It seems an strange issue and it's highly appreciated if you could show me
a sample data file, which, I believe, will make us closer to the resolution.

Thank you for your patience and cooperation. If you have any questions or
concerns, don't hesitate to let me know. We are here to be of assistance!


Sincerely yours,

Michael Cheng
Microsoft Online Support
***********************************************************
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only, many thanks.
 
D

Diarmuid

I'm using Access 2000 on Windows XP. frmInvoice is based on a table called
tabInvoice. Two sample fields would be InvoiceNo and Customer Code. In db1,
I can reference any field in tabInvoice. In db2, I can only only reference
fields that are actually on frmInvoice. So I would get an error if I refered
to Me.InvoiceNo, as this field is not on the form.
I'll mail you a sample later
Regards
Diarmuid
 
M

Michael Cheng [MSFT]

Hi Diarmuid,

Thanks for your update and your files!

I notieced that when I am trying to complie db2.mdb there will be an error
about complier, which means something is not imported. However, I am not
sure your import steps and I could not reproduce it with my Access 2000 on
Windows XP.

I tried to import it with the following steps:
1. Open a new mdb file
2. In Access muenu, I choose: File -> Get External Data -> Import
3. select db1.mdb
4. In the pop-up Dialog 'Import Objects', select all Tables and Queries and
Forms
5. In the Options>> Button, I select Import Relationships, Import Tables:
Definition and Data, Import Queries as Queries
6. Click OK and wait until the import complete.

These steps could make me import db1 to mydb2.mdb successfully and I could
see posted and delAddress1 attributes. So I could not figure out what it
is. Would you please show me how to reproduce your db2.mdb? What's the
definition of posted and DelAddress1? More information will bring us closer
to the resolutions :)

Thank you for your patience and cooperation.


Sincerely yours,

Michael Cheng
Microsoft Online Support
***********************************************************
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only, many thanks.
 
D

Diarmuid

Actually, when I'm tried importing db1 into a new database, it worked fine
this time! All I did for db2 was do File/Get Extrernal Data/Import - the
same as you have listed below.
I can't replicate the problem, so I guess it was just one of those things.
Thank you for your help.
Regards
Diarmuid
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top