set a filter by command button

  • Thread starter Thread starter david
  • Start date Start date
D

david

Is ther a way to have a commmand button set a filter for
a form by a particular field when you click it?
 
david said:
Is ther a way to have a commmand button set a filter for
a form by a particular field when you click it?

Example on a numeric field:
Me.Filter = "[YourFieldName]=" & YourFilterValue
Me.FilterOn = True

Example on a text field:
Me.Filter = "[YourFieldName]='" & YourFilterValue & "'"
Me.FilterOn = True
 
If I want YourFilterValue to use what ever is in the
YourFieldName dependent on the record I am on what would
I use?
-----Original Message-----
david said:
Is ther a way to have a commmand button set a filter for
a form by a particular field when you click it?

Example on a numeric field:
Me.Filter = "[YourFieldName]=" & YourFilterValue
Me.FilterOn = True

Example on a text field:
Me.Filter = "[YourFieldName]='" & YourFilterValue & "'"
Me.FilterOn = True



--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com



.
 
david said:
If I want YourFilterValue to use what ever is in the
YourFieldName dependent on the record I am on what would
I use?

Example on a numeric field:
Me.Filter = "[YourFieldName]=" & Me!YourFieldName
Me.FilterOn = True

Example on a text field:
Me.Filter = "[YourFieldName]='" & Me!YourFieldName & "'"
Me.FilterOn = True
 
Works Great Thanks
-----Original Message-----
david said:
If I want YourFilterValue to use what ever is in the
YourFieldName dependent on the record I am on what would
I use?

Example on a numeric field:
Me.Filter = "[YourFieldName]=" & Me!YourFieldName
Me.FilterOn = True

Example on a text field:
Me.Filter = "[YourFieldName]='" & Me!YourFieldName & "'"
Me.FilterOn = True



--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com


.
 
Just use the built-in right click menu - allows you to put the cursor in any
field, right click, select Sort, and have the form sorted by that field. No
buttons, no code, just user education.

--
Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
 
Back
Top