Variables

Jman

Registered User.
Local time
Today, 17:01
Joined
Oct 11, 2000
Messages
28
Could some one help me with a variable problem I am having. I declared and defined a variable in a module and made that variable public I can pass that variable from form to form and function to function no prob but I am having trouble using the variable to reference a tables field the variable does represent an acurate field name but I still get the object not recognized error any one have any idea why I am trying to reference the field using a statement like this:
[TABLE NAME]![VARIABLE NAME]
and then I tried this:
TABLE NAME![VARIABLE NAME]
then this:
[TABLE NAME]!VARIABLE NAME
and this:
TABLE NAME.VARIABLE NAME
I am sure the answer is a simple syntax thing but I could use any help
thanks for your time truly
John C
 
I know that it is strange for someone to reply to his own posting but I thought that maybe somebody with the same problem could read my posting and my reply
Well in answer to my posting the correct way to reference a variable as a tables field in VBA for Access is like this:
[TABLE NAME] (ITEM)
the word TABLE NAME of course represents the Table that holds the field you wish to reference and the word ITEM is the variable that represents the field in that collection.
 
Not strange at all. Your response answered my question and it works perfectly.

THANKS
 

Users who are viewing this thread

Back
Top Bottom