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

combo and list box link

Status
Not open for further replies.

stuck

MIS
Jan 16, 2002
9
0
0
US
I would like to add a list box to my form to display items based on a category chosen in the Category combo box and my train of thought just derailed, so I would greatly appreciate some help. The form is for entering material ( tbl Materials). The combo box is labelled Category (tbl AddCategory). I've tried a couple of suggestions from the posts but have had only limited success.
Thanks in advance.
 
Let's say your combo box is called cboCat. This listbox is called lstMat
In the AfterUpdate of cboCat, put
Me.lstMat.RowSource = &quot;SELECT * FROM tblMaterials where category = '&quot; & Me.cboCat & &quot;'&quot; '<--assuming Category is text

the Select * is here just for brevity, you may want to just list a few fields, but obvioulsy make the Columncount match the # of columns.
--Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top