How do I base a continuous forms' recordset on the miltiselect column(0) values of a (.rowsource query) listbox?
I Have a list box that fills in with contract numbers in the first column, and details about each contract in the following columns. I want the user to be able to "Multi Select" a few contract numbers within the listbox, and as they select each contract number, that value is added to the forms' (SELECT...WHERE...) query so that the forms continuous detail section contains all the matching records to the values selected in the "Contract #" listbox.
I am fairly new to all this so please bear with me. This is the code so far as I have it.
Private Sub Contract_#_Click()
With Me
.RecordSource = "SELECT * FROM [CONTRACT LIST]" & _
"WHERE [INFO Contract Number] =" & Me.Contract_#
.Refresh
End With
End Sub
I don't know if I should use ".Refresh, .Requery, .Recalc" to refresh the forms information? When I try to run this code the details section just goes blank.
I'm using a single select listbox rightnow just to try and get the form working, and I don't know how the "contract #.Items Selected" property will work when using the multiple values of a field at the end of a "SELECT" query.
Even if I leave out the WHERE part, I get all the records displayed on the form; but, each field of each record says "Name?".
How can this be done?
Someone please help me out,
Thanks,
Blair
I Have a list box that fills in with contract numbers in the first column, and details about each contract in the following columns. I want the user to be able to "Multi Select" a few contract numbers within the listbox, and as they select each contract number, that value is added to the forms' (SELECT...WHERE...) query so that the forms continuous detail section contains all the matching records to the values selected in the "Contract #" listbox.
I am fairly new to all this so please bear with me. This is the code so far as I have it.
Private Sub Contract_#_Click()
With Me
.RecordSource = "SELECT * FROM [CONTRACT LIST]" & _
"WHERE [INFO Contract Number] =" & Me.Contract_#
.Refresh
End With
End Sub
I don't know if I should use ".Refresh, .Requery, .Recalc" to refresh the forms information? When I try to run this code the details section just goes blank.
I'm using a single select listbox rightnow just to try and get the form working, and I don't know how the "contract #.Items Selected" property will work when using the multiple values of a field at the end of a "SELECT" query.
Even if I leave out the WHERE part, I get all the records displayed on the form; but, each field of each record says "Name?".
How can this be done?
Someone please help me out,
Thanks,
Blair