I have a form on which I have checkbox to filter form record.
It works perfectly fine and filters the records without any problem. Below is my code.
PROBLEM:
When I bring this form under a navigation form (button), it asks for the name of the record to enter.
FORM1
Field name: Ordertype and Field record to filter: Current
Code below works perfect.
But on FORM2 with navigation button, which opens this FORM1, when I click on this CurrentChckBox , it asks for to enter value of "OrderType" to filter, and even if I enter the value "Current", It also wont filter. I searched about this, people saying to give path of form, but I could not solve it. Thanks
It works perfectly fine and filters the records without any problem. Below is my code.
PROBLEM:
When I bring this form under a navigation form (button), it asks for the name of the record to enter.
FORM1
Field name: Ordertype and Field record to filter: Current
Code below works perfect.
But on FORM2 with navigation button, which opens this FORM1, when I click on this CurrentChckBox , it asks for to enter value of "OrderType" to filter, and even if I enter the value "Current", It also wont filter. I searched about this, people saying to give path of form, but I could not solve it. Thanks
Code:
If CurrentChckBox = True Then
DoCmd.ApplyFilter , "[Ordertype] = 'Current'"
Else
If CurrentChckBox = False Then
Me.FilterOn = False
Exit Sub
End If
End If