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

combo box that finds a record

Status
Not open for further replies.

kevin531

Technical User
Sep 25, 2002
33
0
0
US
hello,
here is my situation. i have several places on a form (currently subforms) that a combo box drop down list finds a record on my subform. my problem is that i need to view a company name, as well as a contact associated with that company. (there are multiple contacts per company).
i can get it to work by just using the company name, but i can't get it to work by using both the contact and the company name. when the company is select it fills in the subform. i need to link this to my main form so that i can view where a shipment is comming from and going to as well as other information.
any help would be great. thanks.
-Kevin531
 
1.Create 3 queries to pull all three values and assign it combobox as Row source.
Here is a example

Select Case InvSrch ' Your settings
Case 1 'Description
Me![QuickFind].ColumnCount = 3
Me![QuickFind].BoundColumn = 2 'Key field Position in Query
Me![QuickFind].RowSource = "Inventory QuickFind1" 'Query name
Case 2
Me![QuickFind].ColumnCount = 3
Me![QuickFind].BoundColumn = 1
Me![QuickFind].RowSource = "Inventory QuickFind2"
Case 3
Me![QuickFind].ColumnCount = 3
Me![QuickFind].BoundColumn = 3
Me![QuickFind].RowSource = "Inventory QuickFind3"
End Select
 
See if you can apply the technique described in faq702-681.

Alternatively, you might be able to put both the company and the contact into one combo box. You can access the contents of the second column as Combo1.Column(2), and include that in your FindFirst criteria or your Filter string. Rick Sprague
 
Sorry, maybe i didn't explain my situation clearly. what i have is a form with information on it. there are three subforms on it that display company information. a drop down combo box is used to select the companies in the subforms. my problem is that i have multiple companies with the same name and i need a way to distinguish between them. here is what i want in my drop down list:
"company a, bill"
"company a, bob"
this way i will be able to know which company and contact i'm selecting.
i have it now that it works but the drop down only displays the company name, i need to also display the contact in the same drop down box. i hope this makes it clearer.

thanks
kevin531
 
That's what I was suggesting in my second paragraph. It's easy enough to create a 2-column list using a RowSource with the two columns, and setting the Column Count property to 2. And if you need to, it's easy to access the second column.

Is this a case of not realizing it was built in, or do you have some confusion about how to go about it? Rick Sprague
 
It was confusion about how to go about it. i figured it out though. just a matter of finding the right combination of things and linking the right fields. thanks. sorry it took me so long to reply.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top