put in a name next field auto fills with address

E

Elaine

I want to put in someones name then the address field auto fills with the
address held in the table.
 
O

Ofer Cohen

Two options,

1. Create a combo to select name from, when the RowSource of the combo
includes both fields Name And Address
On the Control Source of the Address text box you can write
=[ComboName].Column(1)

Note: the column number start with 0

2. Use DlookUp On the After Update event of the name text box
If Len(Me.[NameTextBox] & "") > 0 Then
Me.[AddressTextBox] =
Nz(DLookup("[Address]","[TableName]","[NameFieldNameInTable] = '" &
Me.[NameTextBox] & "'"),"")
End if
 

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