How do I have a textbox automatically fill in with a value after .

G

Guest

I need to have my textbox populate with a value after I select an item from a
combo box.

Example:: I select a person's last name in a combo box and have their first
name be filled in as well as their age and phone number in a text box.
 
G

Guest

hi,
i usually use DLookup for that.
if isnull(me.lastnamecombobox then
cancel = true
else
me.FirstNameTextbox=(DLookup"[FirstName]"), "yourtable",
"[lastname] = '" & Me.lastnamecombobox & "'")
'note: the above 2 lines wrapped and should be one line.
end if
Pup this in your combobox's before update event.
youwill need 1 DLookup for each text box you want to
populate.
good luck
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top