I have a SubForm that I want to filter the data that displays based on a Field on another Form (not the Parent Form).
Instead of using a query to filter that data I want to use the Me.Filter command.
I am trying to use the Me.Filter command in the Form Open Event but can't get it to work.
The Field in the SubForm Table Record is called PERIOD_EVENT_KEY The Field containing the Other Form matching value is WRK_PERIOD_EVENT_KEY_001.
Here is the syntax I have been trying to use.
Dim M40000_001 As Form
Set M40000_001 = [Forms]![M-40-000 - Event Module Menu]
Dim WRK_PERIOD_EVENT_KEY_001 As String
[WRK_PERIOD_EVENT_KEY_001] = [M40000_001]![PERIOD_EVENT_KEY]
Me.Filter = "PERIOD_EVENT_KEY='" & [WRK_PERIOD_EVENT_KEY_001] & "'"
Me.FilterOn = True
Could you please advise what the correct syntax should be?