Reputation: 1
helping my dad program a temp database in the meantime for our HVAC business (we used to use paradox but that mess has finally stopped working).
What he is looking for is the ability to type in a phone number and pull up the customer's name (First name, Last name) and Cust ID (Our identifying value for the customers). We have a lot of phone numbers so a combo box displaying them all would not be ideal. Any ideas?
What I have currently is 5 boxes that have
=DLookup("CustID","CustT","Phone=" & PhoneLookupF)
But they don't seem to update when I change the value on the PhoneLookupF box by typing stuff in.
Upvotes: 0
Views: 52
Reputation: 21370
If object (field, table, query, form, report) names have spaces, then enclose in [ ]
. Advise not to use spaces nor punctuation/special characters (underscore only exception) in naming convention. If Phone is a text field, need apostrophe delimiters, if not text then remove apostrophes from example.
=DLookup("[First name]", "CustT", "Phone='" & [PhoneLookupF] & "'")
=DLookup("[Last name]", "CustT", "Phone='" & [PhoneLookupF] & "'")
=DLookup("[Cust ID]", "CustT", "Phone='" & [PhoneLookupF] & "'")
This will not recalc until PhoneLookupF loses focus and therefore commits the entered value.
Might find the following tutorials interesting:
http://allenbrowne.com/ser-32.html
http://allenbrowne.com/AppFindAsUType.html
Upvotes: 1