I've been struggling with this for 2 days and cannot get it to work. I have two combo boxes that I want to use to filter qSourceData_Test. I can get the query to open with the correct fields but there is no data. i know it's something simple and would appreciate another set of eyes.
Private Sub btnRunQuery_Click()
Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Dim strSQL As String
Set db = CurrentDb
Set qdf = db.QueryDefs("qryBuildQuery")
strSQL = "SELECT qSourceData_Test.* " & _
"FROM qSourceData_Test " & _
"WHERE qSourceData_Test.SOURCING_SEASON='" & Me.cboSeason.Value & "' " & _
"AND qSourceData_Test.SAP_CAT_DESC='" & Me.cboCategory.Value & "' " & _
"ORDER BY qSourceData_Test.DEV_CD;"
qdf.SQL = strSQL
DoCmd.OpenQuery "qryBuildQuery"
DoCmd.Close acForm, Me.Name
Set qdfTemp = Nothing
Set db = Nothing
Thank you!