Hi, experts.
I would like to ask you where to start with data grid control.
I have a simple form with a combo box with dates (populated from the main query) and I want to put data grid control or something else on same form to get the results of the query based on selected criteria from the combo box. The problem is I cannot find the data grid control or may be I can use something different instead of. Please help
<I am sorry, where is the place where combo box connecting to list box??? >
The combobox is not "connected" to the listbox.
What happens is that the Listbox "Looks" at the combobox for the criteria (filter)
You can see this by examining the RowSource Property of the listbox:
SELECT YourTable.rID, YourTable.rDate, YourTable.rCustID, YourTable.rAmount
FROM YourTable
WHERE (((YourTable.rDate)=[Forms]![YourForm]![Combo0]));
...Here the WHERE clause is the filter.
You can see that it points to the combobox.
So you can translate the SQL to say:
Display (SELECT) all fields
From YourTable
But only show records WHERE the rDate value is the same as the date in the combobox.
and also, and that part i missed:
Private Sub Combo0_AfterUpdate()
Me.List2.Requery
End Sub
Jeffrey Coachman
yes, ...
You need to requery the listbox each time you select a new value in the combobox.
As you can see, this is done on the After Update event of the combobox.