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!

Auto insert data

Status
Not open for further replies.

ajking

Technical User
Aug 13, 2002
229
I have a database (A) which includes two fields for name
and phone number. a separate db (B) has 3 fields -personID, name and phone number, which I have linked to (A). when Using database {A} I start to enter a name in the name field which is a combo box, Access autoenters the rest of the name which I can then accept by pressing enter. What I would like to happen is that when I press enter to accept the suggested name, the phone field automatically picks up the relevant phone number from Database (B).
Can anyone help?
TIA
 
I'm assuming you're entering the name (via the combobox) on a form. If true, I also assume that you have textbox on the form that contains the phone number. If true, then I would base my RowSource for the combobox so that both the name and phone number were included (for example, column(0)=name and column(1)=phone number). Now, the control source of the Phone number text box would look like this:

RowSource:=lstBox.column(1)

Another way to do it, is to set the value of the Phone number in the AfterUpdate event of the combo box.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top