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

Problem Passing (Multiple) Parameters From Textbox

Status
Not open for further replies.

xweyer

MIS
Sep 7, 2000
140
US
I have a form with three major components, (two multi select) list boxes and a text box. The first list box (lboType) passes the primary key for items the user selects to the text box (txtTypeChosen). That part works perfectly.

Next I want to use the contents of the text box to generate the criteria for the second list box (lboObjects) and that is where I’m stuck.

I can get the second list box to display properly if only a single selection is made by setting the criteria for the appropriate field (C_Id) in the second list boxes underlying query (qryObjects) to the text box control on the form but this doesn’t work for multiple selections.

I’m assuming that if this can be done it has to be accomplished by passing the parameter(s) from the textbox to the second list box using VBA but am not sure how to structure the code so that multiple selections pass properly or under which control and property the code should be placed.
 
You could build a query string using IN:
[tt]strSQL="Select * From tblTable Where ID IN ( " & Me.txtTexbox & " )"[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top