I have made a Cascading Combo Boxes form
this form has 3 combo boxes
its working perfectly
i have to select items in all 3 combo boxes to get a report.
what i want is, if i do not select (leave empty) any item in the third combo box it should give me the report for all the items in the third combo box "Me.SubDesCbo"
how can I do that
I am using the following code:
Private Sub cmdOpenReportSingle_Click()
On Error GoTo Err_Handler
Const REPORTNAME = "Yarn Report"
Const MESSAGETEXT = "All Combo's Must Be Selected."
Dim strCriteria As String
' build string expression to filter report
' to selected customer and account
strCriteria = "[ProcessingStatus] = """ & Me.sldcbo & """" & _
" And [YarnType] = """ & Me.TypeCbo & """" & _
" And [ProcessingSubdescription] = """ & Me.SubDesCbo & """"
' make sure a customer is selected
If Not IsNull(Me.TypeCbo) And Not IsNull(Me.SubDesCbo) Then
' open report filtered to selected customer
DoCmd.OpenReport REPORTNAME, _
View:=acViewPreview, _
WhereCondition:=strCriteria
Else
MsgBox MESSAGETEXT, vbExclamation, "Invalid operation"
End If
Exit_Here:
Exit Sub
Err_Handler:
MsgBox Err.Description, vbExclamation, "Error"
Resume Exit_Here
End Sub