Form Filter reference problem (1 Viewer)

ECEK

Registered User.
Local time
Today, 05:48
Joined
Dec 19, 2012
Messages
717
I have a toggle box on my Main form.[frm_frontapage]
This filters a sub form [frm_qry_CR_DATA]

If I hard text my filter on my toggle box the filter works:

Code:
Me.frm_qry_CR_DATA.Form.Filter = "autoaction = 'to be actioned'"
Me.frm_qry_CR_DATA.Form.FilterOn = True


"autoaction = 'to be actioned'"

I want a Combo Box [Combo20] on my main form to do the same filter but to reference what is (afterUpdate) I select in [Comb020]

I cannot seem to filter using the same code e.g.
Code:
Me.frm_qry_CR_DATA.Form.Filter = "autoaction = 'Me.Combo20'"
Me.frm_qry_CR_DATA.Form.FilterOn = True


Thanks chaps !! (and chapesses of course)
 

Minty

AWF VIP
Local time
Today, 05:48
Joined
Jul 26, 2013
Messages
10,371
Have a look here http://access.mvps.org/access/forms/frm0031.htm - you need to refer to the parent form if you are on the sub form, and your syntax is off - try something like;
Code:
Me.frm_qry_CR_DATA.Form.Filter = "autoaction = '" & Me.Parent.Combo20 & "'"
Me.frm_qry_CR_DATA.Form.FilterOn = True
 

ECEK

Registered User.
Local time
Today, 05:48
Joined
Dec 19, 2012
Messages
717
Hi Minty
Im not on the sub form.
Combo20 is on the parent form
So I edited your suggestion(removed the parent bit) and voila !!!
works like a treat
Code:
Me.frm_qry_CR_DATA.Form.Filter = "autoaction = '" & Me.Combo20 & "'"
Me.frm_qry_CR_DATA.Form.FilterOn = True
Many thanks
 

Users who are viewing this thread

Top Bottom