Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get value from other tables 1

Status
Not open for further replies.

Tom123456

Programmer
Apr 2, 2003
70
SE
Hello
How do I get a value from another table. Example if I have a table mapped to a form then I can just write:

Dim test = [column]

But if the column is in another table, how do I do?, or can I mapped more than one table to one form??



- Tom
 
If you want to pull a value from another form you can use:
Code:
MyValue = Forms("FormName").FieldName

If you want to pull a value from a table, use the DLookup function:
Code:
MyValue = DLookup("FieldName","TableName","FieldValue=" & ValueToLookUp)
(Third parameter is optional and allows you to specify the criteria - like a WHERE clause without the keyword)
 
Thanks Norris68!!!!!

I have tried to solve this for days...



- Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top