Got it. But now I have a somewhat relevant question, hoping you can answer it. So I used the code below,
Private Sub cmdOpenReport_Click()
On Error GoTo Err_cmdOpenReport_Click
Dim LReport As String
Dim LCriteria As String
Dim LFilter As String
LReport = DLookup("Report_Name", "tbl_Reports_Home", "Report_ID = " & Forms!frm_Main_Open_Page!cmbReports)
LCriteria = DLookup("Report_Criteria", "tbl_Reports_Home", "Report_ID = " & Forms!frm_Main_Open_Page!cmbReports)
LFilter = DLookup("Report_Filter", "tbl_Reports_Home", "Report_ID = " & Forms!frm_Main_Open_Page!cmbReports)
DoCmd.OpenReport LReport, acViewPreview, , LCriteria
LFilter
Exit_cmdOpenReport_Click:
Exit Sub
Err_cmdOpenReport_Click:
MsgBox Err.Description
Resume Exit_cmdOpenReport_Click
End Sub
I added the LFilter. This isn't so much a filter as so much as what I decided to call it. In my VBA that I used to have open my reports, I had the line,
Reports!ReportName!NameOfTextBox.Visible=True
I used this to display different titles for the same report, depending on the Where condition I used. So I made a new field in my table I just created for the report drop down and inserted that above code. In my VBA I put the above code exactly where I put LFilter but I am getting the error message,
Expected Sub, Function or Property?
I am assuming I have to do more to this, just not sure what. Do you have any suggestions?