Lookup Field (1 Viewer)

TrevAly

New member
Local time
Today, 03:31
Joined
Oct 6, 2000
Messages
6
I want to be able to use VBA to updated a table using another table. For example I type in the phone number and it automatically populates the persons name, address, etc. (gets the information from another table). The form will have other fields as well.

Thanks in advance for any help.
 

Karl K

Registered User.
Local time
Today, 03:31
Joined
Feb 2, 2000
Messages
41
In the Phone number field, after update,
use the code:

Me!Name = Dlookup("Name","Other Table", "[Phone number] = """ & me![Phone Number] & """")
Repeat for each field you want to add...
 

TrevAly

New member
Local time
Today, 03:31
Joined
Oct 6, 2000
Messages
6
Thanks for your respons Karl. Let me know if I'm reading this right. From your example above, does:

1. Name = the name of the field listing the names.
2. Other Table = Subsitute the name of the other table in place of this.
3. Phone number = Subsitute the name of the phone number field.

I typed this in and keep getting a Runtime error '620506' - Data type mismatch in criteria expression.

Me!FirstName = DLookup("FirstName", "tblSecondary", "[AccountNumber] = """ & Me![AccountNumber] & """")

Instead of a phone number I'm using a account number to updated a field called FirstName, LastName, etc. All the data is in a table called tblSecondary. What am I doing wrong???
 

Users who are viewing this thread

Top Bottom