D
Debra Ann
Microsoft Access 2003:
I have a popup form I use to filter a report. It contains two unbound combo
boxes that the user picks from a list on each. I want the ability for the
user to (1) leave both empty and show all info in a report, (2) choose from
one list and filter only on the one item, or (3) choose from both lists and
filter on both items. I have the following code but my problem is I don't
know how to check if the user left the unbound box empty. I tried If
combobox = "" and If combobox = Null but nothing works. Can you tell me what
I would use to test that the combobox has nothing selected?
Thanks.
Dim strWhere As String
If Me.ApplicableProject = Null And Me.ApplicableStatus = Null Then
DoCmd.OpenReport "Action Items by COLA", acPreview
ElseIf Me.ApplicableProject = Null Then
strWhere = "[Applicable Project] = " & Me.ApplicableProject
DoCmd.Close
DoCmd.OpenReport "Action Items by COLA", acPreview, , strWhere
DoCmd.Maximize
ElseIf Me.ApplicableStatus = Null Then
strWhere = "[Status] = " & Me.ApplicableStatus
DoCmd.Close
DoCmd.OpenReport "Action Items by COLA", acPreview, , strWhere
DoCmd.Maximize
Else
strWhere = "[Applicable Project] = " & Me.ApplicableProject & " And
" & "[Status] = " & Me.ApplicableStatus
DoCmd.Close
DoCmd.OpenReport "Action Items by COLA", acPreview, , strWhere
DoCmd.Maximize
I have a popup form I use to filter a report. It contains two unbound combo
boxes that the user picks from a list on each. I want the ability for the
user to (1) leave both empty and show all info in a report, (2) choose from
one list and filter only on the one item, or (3) choose from both lists and
filter on both items. I have the following code but my problem is I don't
know how to check if the user left the unbound box empty. I tried If
combobox = "" and If combobox = Null but nothing works. Can you tell me what
I would use to test that the combobox has nothing selected?
Thanks.
Dim strWhere As String
If Me.ApplicableProject = Null And Me.ApplicableStatus = Null Then
DoCmd.OpenReport "Action Items by COLA", acPreview
ElseIf Me.ApplicableProject = Null Then
strWhere = "[Applicable Project] = " & Me.ApplicableProject
DoCmd.Close
DoCmd.OpenReport "Action Items by COLA", acPreview, , strWhere
DoCmd.Maximize
ElseIf Me.ApplicableStatus = Null Then
strWhere = "[Status] = " & Me.ApplicableStatus
DoCmd.Close
DoCmd.OpenReport "Action Items by COLA", acPreview, , strWhere
DoCmd.Maximize
Else
strWhere = "[Applicable Project] = " & Me.ApplicableProject & " And
" & "[Status] = " & Me.ApplicableStatus
DoCmd.Close
DoCmd.OpenReport "Action Items by COLA", acPreview, , strWhere
DoCmd.Maximize