I have a 16 condition macro that I converted to VBA. Now, I'd like to learn how to set the strFilter as the variable to call up that code. Here's the code with the beginning, ending, and one of the conditions.
Private Sub cmd_Run_Report_Click()
On Error GoTo cmd_Run_Report_Click_Err
If (Eval("[Forms]![frm_TrainingByEe]![cbo_Shift] Is Null And [Forms]![frm_TrainingByEe]![cbo_Bank] Is Null And [Forms]![frm_TrainingByEe]![cbo_Flow_ID] Is Null And [Forms]![frm_TrainingByEe]![cbo_Queue_ID] Is Not Null")) Then
DoCmd.OpenReport "rpt_Training_Employees", acViewReport, "", "[Queue_fk]=[Forms]![frm_TrainingByEe]![cbo_Queue_ID]", acNormal
How would I define the conditions as the variable? Exactly where would I do that in the VBA code?
I would be using this variable to open a report, which I have been made to understand to use as follows:
Docmd.OpenReport "YourReport",acViewReport ,,strFilter)
When I put this strFilter code behind a command button, would I need to add anything else to it in the Build Code window?