I am using Access 2016, I am trying to open a report with a where condition, on a form I have a unbound combo box listing names (Cbo_Fltr_AADCtrCd) (saved as text) and on the report the field to be filtered is (AADInstalledBy) (saved as text) the report will open without the were clause, but when the combobox is selected the report is blank. What Im i doing wrong, listed below is the code that I tried.
If IsNull(Me.Cbo_Fltr_RigNm) Then
DoCmd.OpenReport "Rpt_AAD", acViewPreview
Else
DoCmd.OpenReport "Rpt_AAD", acViewPreview, , "[AADInstallBy]" = " & Forms![Reports_Frm]![Cbo_Fltr_RigNm] & """ 'Report is blank
'DoCmd.OpenReport "Rpt_AAD", acViewPreview, , [AADInstallBy] = "' Forms![Reports_Frm]![Cbo_Fltr_RigNm] " '" 'Does nothing
'DoCmd.OpenReport "Rpt_AAD", acViewPreview, , [AADInstallBy] = " Forms![Reports_Frm]![Cbo_Fltr_RigNm] " 'Does nothing
'DoCmd.OpenReport "Rpt_AAD", acViewPreview, , [AADInstallBy] = "'" & Forms![Reports_Frm]![Cbo_Fltr_RigNm] & "'""" 'Report is blank
'DoCmd.OpenReport "Rpt_AAD", acViewPreview, , [AADInstallBy] = Forms![Reports_Frm]![Cbo_Fltr_RigNm] 'Does Nothing
'DoCmd.OpenReport "Rpt_AAD", acViewPreview, , [AADInstallBy] = " & Forms![Reports_Frm]![Cbo_Fltr_RigNm] & " 'Does nothing
'DoCmd.OpenReport "Rpt_AAD", acViewPreview, , [AADInstallBy] = Forms![Reports_Frm]![Cbo_Fltr_RigNm] 'Does nothing
End If
If IsNull(Me.Cbo_Fltr_RigNm) Then
DoCmd.OpenReport "Rpt_AAD", acViewPreview
Else
DoCmd.OpenReport "Rpt_AAD", acViewPreview, , "[AADInstallBy]" = " & Forms![Reports_Frm]![Cbo_Fltr_RigNm] & """ 'Report is blank
'DoCmd.OpenReport "Rpt_AAD", acViewPreview, , [AADInstallBy] = "' Forms![Reports_Frm]![Cbo_Fltr_RigNm] " '" 'Does nothing
'DoCmd.OpenReport "Rpt_AAD", acViewPreview, , [AADInstallBy] = " Forms![Reports_Frm]![Cbo_Fltr_RigNm] " 'Does nothing
'DoCmd.OpenReport "Rpt_AAD", acViewPreview, , [AADInstallBy] = "'" & Forms![Reports_Frm]![Cbo_Fltr_RigNm] & "'""" 'Report is blank
'DoCmd.OpenReport "Rpt_AAD", acViewPreview, , [AADInstallBy] = Forms![Reports_Frm]![Cbo_Fltr_RigNm] 'Does Nothing
'DoCmd.OpenReport "Rpt_AAD", acViewPreview, , [AADInstallBy] = " & Forms![Reports_Frm]![Cbo_Fltr_RigNm] & " 'Does nothing
'DoCmd.OpenReport "Rpt_AAD", acViewPreview, , [AADInstallBy] = Forms![Reports_Frm]![Cbo_Fltr_RigNm] 'Does nothing
End If