how to reference table field NOT connected to current Form.....

  • Thread starter Thread starter don
  • Start date Start date
D

don

its probably very very simple, and still new to vba and
dao...but cant seem to find exactly in books i have or in
help - the syntax or heirarchy for referencing field in a
table that is NOT the control source for the current form..
do i need to use object variables...define db as currentdb
()...rs as newrecordset....etc...or jsut a sytax thing..
tables!tablename!field....

thanks!!!!
Don
 
Don,

Perhaps one of the domain functions such as DLookUp() might be what you are
looking for. Check it out in VBA Help.
 
=DLookup("[Fieldname]","NameOfTable","<<Some expression that defines the record
you want>>")

Note: "<<Some expression that defines the record you want>>" is optional

Lookup the DLookup function in the Help file.
 
Back
Top