Need Second Combo Added to Form...

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top