resultset and combo box

mike009

New member
Local time
Today, 16:41
Joined
May 11, 2006
Messages
7
Hi
first i want to say i'm new in this vb micros things, but i have some back ground in othe programming langauges ... any way

i have form with 2 combo boxes, one text box and one search button
the first combo box "CustomerCB" display list of customer names "
the second combo box "productsCB" display products name
i manange to disable one of the cobo boxes if the other is selected

so it can be only one active combo box (sure there is also reset botton to reset
every thing)

i want create a code that will check the active combo box and select all from its table

examble if customerCB.Enable = true then
query as String = "Select * From Order where Custmerid =" & customerCB.value

how can i execute this query and how can i display the results in text box
thx in advance
 
Me.combobox.requery will execute the query

Why display it in a textbox? Is beeing displayed in the combo, Right?
 
namliam said:
Me.combobox.requery will execute the query

Why display it in a textbox? Is beeing displayed in the combo, Right?

i think my question was not clear
the combobox will not execute any query

1- combobox (list of customer id's)
2- searchButton (execute query)

what should happen is, first select user id from the combobox and click on search button, here i add click event on the click button

Private Sub searchB_Click()
Dim querystring As String
querystring ="Select * From Order where Custmerid =" & customerCB.value

how can i run this query and how can i display it in text box


thx
 
I think you should use listbox to display your Order's records

Listboxname.RowSource = querystring
Listboxname.requery
:D
 
You can use a listbox, subform or a plain old query... Just take your pick...
 

Users who are viewing this thread

Back
Top Bottom