G
Guest
Ok, I am hoping that if I can get this one correct, then I will be able to
get the other combo boxes to work.... as it now stands, the first if
statement works, but the second if statement will not open the query...
Dim strwhere As String
If Not IsNull(Me.combo1) Then
strwhere = strwhere & "[queryname.datefield]Between " & Me.BegYR & " And
" & Me.EndYR
End If
If Not IsNull(Me.combo2) Then
If Len(strwhere) > 0 Then
strwhere = strwhere & " And "
End If
strwhere = "[queryname.field]=" & Me.combo2
End If
DoCmd.OpenReport "Report", acPreview, , strwhere
get the other combo boxes to work.... as it now stands, the first if
statement works, but the second if statement will not open the query...
Dim strwhere As String
If Not IsNull(Me.combo1) Then
strwhere = strwhere & "[queryname.datefield]Between " & Me.BegYR & " And
" & Me.EndYR
End If
If Not IsNull(Me.combo2) Then
If Len(strwhere) > 0 Then
strwhere = strwhere & " And "
End If
strwhere = "[queryname.field]=" & Me.combo2
End If
DoCmd.OpenReport "Report", acPreview, , strwhere