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

Using one combo box to select data from another combobox

Status
Not open for further replies.

techkenny1

Technical User
Jan 23, 2009
182
AU
Hi,
1. On an invoice form I have a combobox (1) which inserts data , such as company name, Address, Rates etc into the relevant fields.

There are some companies that have special requests at times that we need to bill,so for this purpose I have another combo box (2) which has this information.
This inserts data, such as type of service and the rates into the billing fields.

The problem is that the combo box (2) will show all the companies data.

Is is possible that when the company is initially selected by combo box (1) that when the 2nd combo box is selected that only those records for that company will be selected.

Many thanks,

Ken

 
At least 2 FAQs:
faq702-4289
faq702-4640

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
How are ya techkenny1 . . .

In the [blue]AfterUpdate[/blue] event of combobox1 you should have something like:
Code:
[blue]   Me.[purple][b]Combobox2Name[/b][/purple].Requery
   [green]'
   'your code here
   '[/green][/blue]
The [blue]RowSource[/blue] of combobox2 should be based on a query who's WHERE clause resembles the following:
Code:
[blue]WHERE [CompanyID] = Forms!FormName!Combobox1Name OR Forms!FormName!Combobox1Name IS NULL[/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top