dbTalk Databases Forums  

Strange compile problem using me. keyword - Access 2010

comp.databases.ms-access comp.databases.ms-access


Discuss Strange compile problem using me. keyword - Access 2010 in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
exebat
 
Posts: n/a

Default Strange compile problem using me. keyword - Access 2010 - 08-27-2010 , 09:10 AM






Hi all.

I had some strange problem before and i created the new table and
imported all the objects in it.

Now I have a strange compile problem.

It is giving me the "Method or data member not found" on the following
statement:

Me.InvoiceNumber.value = 123


Invoice number is not present as a field on the form but it is present
in the forms recordset.

There are two things that can let me go by this -

use the ME! keyword

or

replace "Microsoft Office 14 Access Data Object Engine" with DAO 3.6
reference.


Old database is working just fine with the "Microsoft Office 14 Access
Data Object Engine" reference.


What can I do ?

P.S. The old database was created in Access 2007, then followed Access
2010 14.0.4734 version (beta) now I bought the Professional version
14.0.4760 and that is when strange things started to happen.

Reply With Quote
  #2  
Old   
exebat
 
Posts: n/a

Default Re: Strange compile problem using me. keyword - Access 2010 - 08-27-2010 , 09:16 AM






Also when I move the database from my PC to other i get then "Invalid
database Object reference".

When i do "Compact And Repair" it works.

Reply With Quote
  #3  
Old   
Salad
 
Posts: n/a

Default Re: Strange compile problem using me. keyword - Access 2010 - 08-27-2010 , 12:55 PM



exebat wrote:

Quote:
Hi all.

I had some strange problem before and i created the new table and
imported all the objects in it.

Now I have a strange compile problem.

It is giving me the "Method or data member not found" on the following
statement:

Me.InvoiceNumber.value = 123


Invoice number is not present as a field on the form but it is present
in the forms recordset.

There are two things that can let me go by this -

use the ME! keyword

or

replace "Microsoft Office 14 Access Data Object Engine" with DAO 3.6
reference.


Old database is working just fine with the "Microsoft Office 14 Access
Data Object Engine" reference.


What can I do ?

P.S. The old database was created in Access 2007, then followed Access
2010 14.0.4734 version (beta) now I bought the Professional version
14.0.4760 and that is when strange things started to happen.

Why not add InvoiceNumber to the form and set visible=false?

Reply With Quote
  #4  
Old   
exebat
 
Posts: n/a

Default Re: Strange compile problem using me. keyword - Access 2010 - 08-27-2010 , 01:42 PM



Quote:
Why not add InvoiceNumber to the form and set visible=false?
It is just an example. There are many more fields on other forms that
do not need to be on the form but are in the recordset. At least they
were not on the form before and all worked fine and still works on old
database.

Reply With Quote
  #5  
Old   
David W. Fenton
 
Posts: n/a

Default Re: Strange compile problem using me. keyword - Access 2010 - 08-27-2010 , 02:14 PM



exebat <srdjan.vasiljevic (AT) gmail (DOT) com> wrote in
news:24fd29f3-2d3c-4925-b378-b9df9dd839a8 (AT) i31g2000yqm (DOT) googlegroups.co
m:

Quote:
There are two things that can let me go by this -

use the ME! keyword
I don't see why this isn't the best answer (i.e., using the !
operator instead of the .).

There has been a disconnect between Access forms and the fields in
the underlying recordset ever since the introduction of A2000, and
referring to fields in the recordset has just been less reliable.
I've never encountered a direct reference failing, but I've
definitely seen the problem with references in a subform from the
parent form (and vice versa). In those case, as Salad suggests, the
solution (as with reports) was to add a hidden control with the
needed field as ControlSource. This seems to wake up the Access
expression service so it recognizes that the field is valid.

Or, you can use the !.

It's a no-brainer to me.

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/

Reply With Quote
  #6  
Old   
exebat
 
Posts: n/a

Default Re: Strange compile problem using me. keyword - Access 2010 - 08-27-2010 , 02:29 PM



I just want to find out what changed ?

If i use Me! i dont have intellisense or word prediction. I am used to
Me. .

What about "Invalid database Object reference" on other computers ?

Why it works with DAO 3.6 that is even not in the references in the
old database ?

It all works in the old database without any change.

Reply With Quote
  #7  
Old   
exebat
 
Posts: n/a

Default Re: Strange compile problem using me. keyword - Access 2010 - 08-27-2010 , 03:01 PM



I reinstalled Access, created new database and imported all over
again. I no longer have the Me. problem, but I still have the "Invalid
database Object reference".

When I copy the database to any other computer I get this error, and I
cant do anything until I do "Compact and repair". Since my software
uses automatic updating, it is a really big problem for me.

Reply With Quote
  #8  
Old   
Salad
 
Posts: n/a

Default Re: Strange compile problem using me. keyword - Access 2010 - 08-27-2010 , 04:05 PM



exebat wrote:

Quote:
I reinstalled Access, created new database and imported all over
again. I no longer have the Me. problem, but I still have the "Invalid
database Object reference".

When I copy the database to any other computer I get this error, and I
cant do anything until I do "Compact and repair". Since my software
uses automatic updating, it is a really big problem for me.
What happens if you move DAO3.6 ref above the ref for Microsoft Office
14 Access Data Object Engine.

Why don't you list your references and the order?

Reply With Quote
  #9  
Old   
exebat
 
Posts: n/a

Default Re: Strange compile problem using me. keyword - Access 2010 - 08-27-2010 , 04:13 PM



Quote:
What happens if you move DAO3.6 ref above the ref for Microsoft Office
14 Access Data Object Engine.

Why don't you list your references and the order?
I dont have DAO 3.6 reference in any database.


Here is my reference list:


Visual Basic For Applications
Microsoft Access 14 Object Library
Ole Automation
Microsoft Office 14 Access Database Engine object
Microsoft HTML object library
Microsoft WMI Scripting V1.2
Microsoft Scripting Runtime
Microsoft Windows Common Controls 6.0 (SP6)

Reply With Quote
  #10  
Old   
David W. Fenton
 
Posts: n/a

Default Re: Strange compile problem using me. keyword - Access 2010 - 08-28-2010 , 02:06 PM



exebat <srdjan.vasiljevic (AT) gmail (DOT) com> wrote in
news:248a0775-662c-49bc-b224-ba71bac69736 (AT) z10g2000yqb (DOT) googlegroups.co
m:

Quote:
I just want to find out what changed ?

If i use Me! i dont have intellisense or word prediction. I am
used to Me. .
If you hit Ctrl-space, you get an Intellisense list, and once you
type a character or two, you'll get what you need. I find
Intellisense useful not for the list, but for the parameters of
functions/methods, so that has never seemed a lack to me.

Quote:
What about "Invalid database Object reference" on other computers
?

Why it works with DAO 3.6 that is even not in the references in
the old database ?

It all works in the old database without any change.
I would guess at corruption of the VBA project, and would do a
decompile/compile cycle.

--
David W. Fenton http://www.dfenton.com/
contact via website only http://www.dfenton.com/DFA/

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.