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!

Select values from Combo boxes and display in Listbox

Status
Not open for further replies.

Drummermoose

Technical User
Jan 22, 2002
48
GB
I have a Table called 'Man Orders' with fields 'ID' 'Faxed Order Date' 'Company' 'Product' 'Customer Name' 'Order no' 'Ackn Rec Date' 'Delivery Est'

I want to design a form so that I can have 3 combo boxes, 1) 'Company' 2)'Customer Name' 3)'Order no'
I want to select values from any or all of the combo boxes and display the results in a listbox with all the fields from the table.

I've looked through quite a few treads on this forum but can't get any to work for me.
I'm using Access 97.

thanks in advance.
 
Not really sure what u are looking for in a design, but u can have the RowSource for the List box set ot a variable that you can populate. Likewise, you could also build a dynamic query and drop it into the RowSource of the list box. Below is a small psuedo code example. htwh..

Private Sub Combo0_Change()
Dim lcVar1 As String
lcVar1 = lcVar1 & Me.Combo0.Value & ";" & Me.Combo2.Value & ";"
Me.List4.RowSource = lcVar1
Me.List4.Requery
End Sub

Private Sub Combo2_Change()
Dim lcVar1 As String
lcVar1 = lcVar1 & Me.Combo0.Value & ";" & Me.Combo2.Value & ";"
Me.List4.RowSource = lcVar1
Me.List4.Requery
End Sub Steve Medvid
"IT Consultant & Web Master"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top