S
Sharon
Hi:
I have the following code on a combo box on my form header:
Private Sub cboRegion_AfterUpdate()
Me.Detail.Visible = True
'SELECT qryYTD_Sales.* FROM qryYTD_Sales;
Dim SQL As String
SQL = "SELECT qryYTD_Sales.* FROM qryYTD_Sales"
If IsNull(Me![cboRegion]) Then
Me.RecordSource = SQL & ";"
Me.Requery
Exit Sub
End If
SQL = SQL & " Where [Region]='" & Me![cboRegion] & "';"
Me.RecordSource = SQL
Me.Requery
End Sub
When I open my form it's blank. I select a region and the
sales for all the stores in that region appear on my form
detail. How do I add a second combo to filter this form
down even more. For instance, I've added a second combo
called cboLocation. I've set the Row Source to SELECT
Location From YTD_Sales GROUP BY Location ORDER BY
Location. The combo displays my location, but I don't
know how to get it to work with the first combo box. Any
suggestions.
Thanks,
Sharon
I have the following code on a combo box on my form header:
Private Sub cboRegion_AfterUpdate()
Me.Detail.Visible = True
'SELECT qryYTD_Sales.* FROM qryYTD_Sales;
Dim SQL As String
SQL = "SELECT qryYTD_Sales.* FROM qryYTD_Sales"
If IsNull(Me![cboRegion]) Then
Me.RecordSource = SQL & ";"
Me.Requery
Exit Sub
End If
SQL = SQL & " Where [Region]='" & Me![cboRegion] & "';"
Me.RecordSource = SQL
Me.Requery
End Sub
When I open my form it's blank. I select a region and the
sales for all the stores in that region appear on my form
detail. How do I add a second combo to filter this form
down even more. For instance, I've added a second combo
called cboLocation. I've set the Row Source to SELECT
Location From YTD_Sales GROUP BY Location ORDER BY
Location. The combo displays my location, but I don't
know how to get it to work with the first combo box. Any
suggestions.
Thanks,
Sharon