sorry thought it was in that part of the function. here's the full function i'm working with
Dim myActors, myCategories, myGender, myYear As String
Dim task1, task2, strCriteria, strCriteria2 As String
If IsNull(Me.cboActors) Then
myActors = "[ActorsID] like '*'"
Else
myActors = "[ActorsID] = " & Me.cboActors
End If
'If IsNull(Me.cboCategories) Then
'myCategories = "[GenreID] like '*'"
'Else
'myCategories = "[GenreID] = " & Me.cboCategories
'End If
'If IsNull(Me.cboGender) Then
'myGender = "[Gender] like '*'"
'Else
'myGender = "[Gender] = '" & Me.cboGender & "'"
'End If
'If IsNull(Me.cboYearofrelease) Then
'myYear = "[YearofRelease] like '*'"
'Else
'myYear = "[YearofRelease] = " & Me.cboYearofrelease
'End If
strCriteria = myActors & "and" & myGender & "and" & myYearofrelease
strCriteria2 = myCategories
task1 = "Select * from qryMergeGenre where " & strCriteria
task2 = "Select * from qryMerge where " & strCriteria2
Me.subfrmSearch.Form.RecordSource = task1
Me.subfrmSearch.Form.RecordSource = task2
Me.subfrmSearch.Form.Requery
End Function