M
Mavis
Hi All,
I have this below codes. In the last 4th line, (Me.Filter = "Status <>
'disposed'"), is there a way that i can allow user to select the "<>" and
'disposed" from a form. Which mean that i will have a form with a choice of
"<>" or "=", and the other status 'disposed", "In use", etc. the code will be
taken from the choices from the form.
Example: If the user select "=" and "In Use", then the code will become
Me.Filter = "Status = 'In Use'".
Private Sub Show_All_Records_Click()
'Button will display "Show All Records" when first load the form
'It will change to "Filter Records" once the button is click
If Show_All_Records.Caption = "Show All Records" Then
Show_All_Records.Caption = "Filter Records"
'All records will be display
Me.Filter = ""
Me.FilterOn = True
Else: Show_All_Records.Caption = "Show All Records"
'Record with Status does not equal to "disposed" will display
Me.Filter = "Status <> 'disposed'"
Me.FilterOn = True
End If
End Sub
I have this below codes. In the last 4th line, (Me.Filter = "Status <>
'disposed'"), is there a way that i can allow user to select the "<>" and
'disposed" from a form. Which mean that i will have a form with a choice of
"<>" or "=", and the other status 'disposed", "In use", etc. the code will be
taken from the choices from the form.
Example: If the user select "=" and "In Use", then the code will become
Me.Filter = "Status = 'In Use'".
Private Sub Show_All_Records_Click()
'Button will display "Show All Records" when first load the form
'It will change to "Filter Records" once the button is click
If Show_All_Records.Caption = "Show All Records" Then
Show_All_Records.Caption = "Filter Records"
'All records will be display
Me.Filter = ""
Me.FilterOn = True
Else: Show_All_Records.Caption = "Show All Records"
'Record with Status does not equal to "disposed" will display
Me.Filter = "Status <> 'disposed'"
Me.FilterOn = True
End If
End Sub