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

Another Combo Box Question!

Status
Not open for further replies.

SeadnaS

Programmer
May 30, 2011
214
I have two combo boxes one lists tables in my database the other one has 4 entries that I want to use to filter the other combo box with. I have BP, NOD, QOD and RBPOD. When i select, say, QOD from the second combo box I want the first one to only list tables that contain the letters QOD.

Any help appreciated!
 

What is the RowSource for your 1st ComboBox? What is the RowSourceType?

If the RowSourceType is Table/Query, you would need a Where Clause like
Code:
WHERE [i]tablenamefield[/i] LIKE "*" & SecondCombo & "*"
That is only an approximation. Need to see what you are using now to be more specific. You would need to change it on the AfterUpdate Event of SecondCombo.

If it is a ValueList you need to change the list and that could get very complicated.

In either case, we would need to see what you are using in order to tell you how to make it work. <-------- (Always Applies)


 
Row source for combo 2
Code:
SELECT 
 MSysObjects.Name
FROM 
 MSysObjects
WHERE 
 MSysObjects.Name Not Like "*MSys*" 
 And MSysObjects.Name Like "*" & Forms![YourForm]![YourCombo1] & "*" 
 AND MSysObjects.Type = 1;

On enter of combo 2

private sub yourCombo2_Enter()
yourCombo2.requery
end sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top