G
Guest
The program has 3 option buttons to choose from, you can choose 1, 2, or 3,
or any combination of 1 and 2, or 2 and 3, or 1,2,3 etc...they all work
except for the last option button, it wont work on its own, but if u choose
option 1 and 3, or 2 and 3, or 1, 2, 3 then opt 3 works, but if u choose opt
3 by itself it wont work... (can anybody explain why it wont work?)
Dim strwhere As String
strwhere = ""
If Not IsNull(Me.FY1) Then
strwhere = strwhere & "[queryfile.date1]Between " & Me.BegYR & " And " &
Me.EndYR
End If
If Not IsNull(Me.FI2) Then
If Len(strwhere) > 0 Then
strwhere = strwhere & " And "
End If
strwhere = strwhere & "[queryfile.fileno]= " & Chr$(34) & Me.combo2
& Chr$(34)
End If
If Not IsNull(Me.SB5) Then
If Len(strwhere) > 0 Then
strwhere = strwhere & " And "
End If
strwhere = strwhere & "[queryfile.subject]LIKE ""*" & Me.textbox & "*"""
end if
DoCmd.OpenReport "database1", acPreview, , strwhere
or any combination of 1 and 2, or 2 and 3, or 1,2,3 etc...they all work
except for the last option button, it wont work on its own, but if u choose
option 1 and 3, or 2 and 3, or 1, 2, 3 then opt 3 works, but if u choose opt
3 by itself it wont work... (can anybody explain why it wont work?)
Dim strwhere As String
strwhere = ""
If Not IsNull(Me.FY1) Then
strwhere = strwhere & "[queryfile.date1]Between " & Me.BegYR & " And " &
Me.EndYR
End If
If Not IsNull(Me.FI2) Then
If Len(strwhere) > 0 Then
strwhere = strwhere & " And "
End If
strwhere = strwhere & "[queryfile.fileno]= " & Chr$(34) & Me.combo2
& Chr$(34)
End If
If Not IsNull(Me.SB5) Then
If Len(strwhere) > 0 Then
strwhere = strwhere & " And "
End If
strwhere = strwhere & "[queryfile.subject]LIKE ""*" & Me.textbox & "*"""
end if
DoCmd.OpenReport "database1", acPreview, , strwhere