D
De'Ville
I am quite new to this, I have this button in my form, it
filters the records in a table using the following piece
of code bellow. What i am doing is filtering the records
using a field in that my table called 'Status', in the
field status some of the records have the word 'Active'
and others have the word 'Resolved' when I click the
button to filter the records so that only records with
the word 'Active' in the 'Status' field are displayed, it
brings up a little dialoge box that says "Enter Parameter
Value" if I Type 'Active' The correct records are
displayed, which is ok, but what i am really trying to do
is make the button so that it automatically looks for the
correct records without my having to type the
word 'Active'. thanks
Private Sub FilterButton_Click()
On Error GoTo Err_FilterButton_Click
Dim QryFld As String
Dim CurRecNo As String
Let CurRecNo = Form.CurrentRecord
QryFld = " Status "
DoCmd.ApplyFilter , "[Status] like Active"
Exit_FilterButton_Click:
Exit Sub
Err_FilterButton_Click:
MsgBox Err.Description
Resume Exit_FilterButton_Click
End Sub
filters the records in a table using the following piece
of code bellow. What i am doing is filtering the records
using a field in that my table called 'Status', in the
field status some of the records have the word 'Active'
and others have the word 'Resolved' when I click the
button to filter the records so that only records with
the word 'Active' in the 'Status' field are displayed, it
brings up a little dialoge box that says "Enter Parameter
Value" if I Type 'Active' The correct records are
displayed, which is ok, but what i am really trying to do
is make the button so that it automatically looks for the
correct records without my having to type the
word 'Active'. thanks
Private Sub FilterButton_Click()
On Error GoTo Err_FilterButton_Click
Dim QryFld As String
Dim CurRecNo As String
Let CurRecNo = Form.CurrentRecord
QryFld = " Status "
DoCmd.ApplyFilter , "[Status] like Active"
Exit_FilterButton_Click:
Exit Sub
Err_FilterButton_Click:
MsgBox Err.Description
Resume Exit_FilterButton_Click
End Sub