Hi,
I have three combo boxes on a form. When the user clicks the ok button a query will run with whatever criteria the user has selected from the combo boxes. The code is below, but i cant get it to work
I have three combo boxes on a form. When the user clicks the ok button a query will run with whatever criteria the user has selected from the combo boxes. The code is below, but i cant get it to work

Code:
Private Sub cmdOK_Click()
Dim db As DAO.Database
Dim qdf As DAO.QueryDef
Dim strSQL As String
Set db = CurrentDb
Set qdf = db.QueryDefs ("qryStaffListQuery")
If IsNull(Me.cboOffice.Value) Then
strOffice = " Like '*’”
Else
strOffice = "='” & Me.cboOffice.Value & "’ ”
End If
strSQL = "SELECT tblStaff.* " & _
"FROM tblStaff " & _
"WHERE tblStaff.Office='" & Me.cboOffice.Value & "' " & _
"AND tblStaff.Department='" & Me.cboDepartment.Value & "' " & _
"ORDER BY tblStaff.LastName,tblStaff.FirstName;"
End Sub