Re: Filter by selection



Hi Chey

If TA Number is a numeric field:

Me.Filter = "[TA Number]=" & Me![TA Number]
Me.FilterOn = True

and if it's a text field

Me.Filter = "[TA Number]='" & Me![TA Number] & "'"
Me.FilterOn = True

Note that the [TA Number] after Me! is the name of the control (textbox),
which could be different from the name of the field.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand

"Chey" <Chey@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:C76F4639-F2A5-4ECA-AF36-15A4DB90A20A@xxxxxxxxxxxxxxxx
I have the focus on a field. What is the code to filter by selection.
my field name is Travel Request.TA Number.
Thanks


.



Relevant Pages

  • Re: DLookUp is driving me crazy.
    ... If UrgencyID is a numeric field in the table t_Urgency: ... <MS ACCESS MVP> ... just on it's own it display a result number just fine. ...
    (microsoft.public.access.gettingstarted)
  • Re: SQL statement
    ... John Spencer ... Access MVP 2002-2005, 2007-2009 ... What is wrong in this SQL statement if I need to run thru VBA where the YEAR field is a numeric field? ...
    (microsoft.public.access.modulesdaovba)
  • Re: Empty field generates "0" entries? How to avoid?
    ... You must make all table design changes in the backend where the tables ... <MS ACCESS MVP> ... >>numeric field should default to 0 (which is sometimes a good idea, ... > right away and deleted the zero. ...
    (microsoft.public.access.gettingstarted)
  • Re: yes/no data type custom
    ... Ohhhhh! ... > Duane Hookom ... > MS Access MVP ... you may have entered text in a numeric field or a number ...
    (microsoft.public.access.gettingstarted)