I need a way to override the query setup for a form (frm1) using VBA. The query has criteria that is based solely on a separate form (frm2). I now need to be able to open the same form (frm1) but using criteria from another form (frm3). I'm trying the following
DoCmd.OpenForm rstAllSubs![FN], acNormal, , Client_ID = Me.Client_ID And Batch_Number = Me.Batch_Number
but the form is based on Client_ID = [Forms]![Click Here to Search for or Add Cookbook]![Cookbook Query1]![Client ID] and Batch_Number = [Forms]![Click Here to Search for or Add Cookbook]![Cookbook Query1]![Batch Number] so it asks me for these criteria again before it will open.
Any suggestions on how I can modify this to work?
DoCmd.OpenForm rstAllSubs![FN], acNormal, , Client_ID = Me.Client_ID And Batch_Number = Me.Batch_Number
but the form is based on Client_ID = [Forms]![Click Here to Search for or Add Cookbook]![Cookbook Query1]![Client ID] and Batch_Number = [Forms]![Click Here to Search for or Add Cookbook]![Cookbook Query1]![Batch Number] so it asks me for these criteria again before it will open.
Any suggestions on how I can modify this to work?