Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Substitute Me! for Forms![Main_form]

Status
Not open for further replies.

btrini10

IS-IT--Management
Dec 5, 2006
73
US
Hi all
I have two forms with the same subform. On the subform I have a button that when clicked opens another form using the filter below. I owuld like to create the filter so that both main forms can use the same filter.

strFilter = "[STATUS_ID] = " & [Forms]![FORENSIC_OBSERVATION]![qry_OBSERVATION_STATUS subform].[Form]![STATUS_ID]

strFilter = "[STATUS_ID] = " & [Forms]![RE_AMOUNT_FORM]![qry_OBSERVATION_STATUS subform].[Form]![STATUS_ID]

As you can see, the only difference is the Main form.
Can I substitute Me! so that I can use the same filter?
I have tried

Me![qry_OBSERVATION_STATUS subform].[Form].[STATUS_ID]

but it does not work.

Any help would be appreciated
 
Me refers to the class object (and data) on the current form.
To refer to the parent form, you can use:

Parent![Controlname]

instead. This will get around the need to use different filters depending on the parent form it uses.

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top