Originally Posted by
mindbender
This is awesome. I am well on my way. Thank you very much.
Weird - it worked the first time then it stopped working.
I attached a picture of the design view form with the txt fields used for searching...txtCode, txtCarrier and txtMCode
When the Filter button is clicked, this runs
Code:
Private Sub Command36_Click()Dim sWhere As String
sWhere = "1=1"
If Not IsNull(Me.txtCode) Then sWhere = sWhere & " and [PROD_CD]='" & Me.txtCode & "'"
If Not IsNull(Me.txtCarrier) Then sWhere = sWhere & " and [SUB_LOC_CD]='" & Me.txtCarrier & "'"
If Not IsNull(Me.txtMCode) Then sWhere = sWhere & " and [MKT_CD]='" & Me.txtMCode & "'"
If sWhere = "1=1" Then
Me.FilterOn = False
Else
Me.Filter = sWhere
Me.FilterOn = True
End If
End Sub
This is not returning any data at all. It did the first time I ran it but not any time after
The unfilter button onclick runs this:
Code:
Private Sub Command40_Click()
Me.FilterOn = False
Me.txtCode.Value = ""
Me.txtCarrier.Value = ""
Me.txtMCode.Value = ""
Me.Refresh
End Sub
I am so close...thanks for the help