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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Name & Number lookup

Status
Not open for further replies.

cdawley4

Technical User
Aug 6, 2004
25
US
Hi,

I have a database that contains a main table and several lookup wizard tables linked to the main table. Within the database, I have some Names and Phone numbers. I also have a form that I can fill out. On the form, I have the names and phone numbers as well, with a row source pointing back to the table containing just the names and numbers. I want to be able to have the names in a combo box to select and have their phone number automatically fill in once a name is selected. How can I accomplish this?

Thanks,

Chris
 
Have you tried to follow the combo wizard ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
I tried the combo box and it didn't accomplish what I was doing. The names are in a combo box and the phone number field is set up as a text box. I want to be able to pick a name from the combo box and have it fill in my text box with the phone number that matches the name on my combo box. I am pulling my names and numbers from a seperate table that contain the names and phone numbers. Does anyone have any suggestions?
 
Something like this ?
In the AfterUpdate event procedure of the ComboBox:
Me![phone number control name] = Me![combo name].Column(1)

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
That almost works. If I leave off the .Column(1), I get the info in the Combo Name box. If I add the .Column(1), I get nothing. I tried .Column(2) since the phone number is in Column 2. That doesn't work. Am I missing something?

Thanks,

Chris
 
the phone number is in Column 2
The Column collection is option base 0, so the 2nd column is Column(1).

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
That doesn't work with the Column(1). Any more suggestions?
 
PHV,

Thanks for your help. I figured out what was happening. I had the datebase pulling information from a different query and trying to get the VB Script to work as well. I created a test database to see if it would really work and it did. That is how I found out it was a query/VB Script conflict.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top