Hello,
I'm trying to filter a 'single form' sub-form when the main form opens. I need the sub-form to show a participial record that is dictated by the filter criteria. The Main form opens but I get an error message and filter fails. Note: both sample_id (primary key) and run_name are strings.
Here is the vba code I'm using:
Is the filter failing because I'm trying to filter a Single Form? Thanks, Mila
I'm trying to filter a 'single form' sub-form when the main form opens. I need the sub-form to show a participial record that is dictated by the filter criteria. The Main form opens but I get an error message and filter fails. Note: both sample_id (primary key) and run_name are strings.
Here is the vba code I'm using:
Code:
strform = "frm_combined_CNVs"
Criteria = "[sample_id] = '" & empty_sample1 & "' AND [run_name] = '" & Me.txt_Run_Name.Value & "'"
Debug.Print Criteria
DoCmd.OpenForm strform
Application.Echo False
Forms!frm_combined_CNVs.frm_sample_cnv1.Form.Filter = Criteria
Forms!frm_combined_CNVs.frm_sample_cnv1.Form.FilterOn = True
Application.Echo True
Is the filter failing because I'm trying to filter a Single Form? Thanks, Mila