Hi All,
I have this form below and this is working well with the below coding. I just want to add one more category which is [DocStatus]. Can help me please. I've been trying but it really wont run if I add one more field. Thank you guys.
Function SearchCriteria()
Dim Dept, strDocType, strStatus As String
Dim task, strCriteria As String
If IsNull(Me.cbo_Dept) Then
Dept = "(Dept) like '*'"
Else
Dept = "(Dept) = '" & Me.cbo_Dept & "'"
End If
If IsNull(Me.cbo_DocType) Then
strDocType = "(DocType) like '*'"
Else
strDocType = "(DocType) = '" & Me.cbo_DocType & "'ORDER BY tbl_TR.ID ASC"
End If
strCriteria = Dept & "And" & strDocType
task = "Select * from tbl_TR where " & strCriteria
Me.SubForm_TR.Form.RecordSource = task
Me.SubForm_TR.Form.Requery
End Function