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!

Filling listbox with field from query??

Status
Not open for further replies.

Frank72

Technical User
Nov 13, 2001
57
IE
Evenin' all

I've got a form with 2 listboxes when i click an option in the first box i want the second to be be filled (automatically)with a 1 field query that is run and affected by what is selected in the first box. the on click event for furst runs the query (not showing) and the record source for second is the said query. can i use any code or anything to get this field to populate the list box using the on click of the first box??

thanks alot

frank
 
Yes you can. And use the Selected method of the listbox to figure out which item is selected. Then use the itemdata method to get the value of the item selected. Hope it helps.
 
Hi Frank!

Set the rowsource of the second list box to the query you mentioned with the where clause referencing the first list box. In the Click event of the first list box type:

YourSecondListBox.Requery

hth Jeff Bridgham
bridgham@purdue.edu
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top