Sub/Function not defined
I’m trying to user the enclosed function to build my report’s filter criteria but as per below, the COMMANDBARCOMBOBOX statement keeps stopping with the error message that the “Sub or Function is not defined.” Any help would be appreciated.
'determines WHERE criteria to apply to a report…
Function buildSQL()
strSQL = "PromotionType= " & Choose(CommandBarComboBox(filterType).ListIndex, "BE", "OA") & " and year(mediaStartDate) like filteryear"
DoCmd.OpenReport objName, acViewPreview, , strSQL
End Function
I’m trying to user the enclosed function to build my report’s filter criteria but as per below, the COMMANDBARCOMBOBOX statement keeps stopping with the error message that the “Sub or Function is not defined.” Any help would be appreciated.
'determines WHERE criteria to apply to a report…
Function buildSQL()
strSQL = "PromotionType= " & Choose(CommandBarComboBox(filterType).ListIndex, "BE", "OA") & " and year(mediaStartDate) like filteryear"
DoCmd.OpenReport objName, acViewPreview, , strSQL
End Function