Hey Guys,
I am new to vba and I need some help with writing the correct syntax for the code to work. Basically I have the following logic:
I want to add an IF statement to check - If "qryReportBuilderNewTwo" doesn't return any results then run another query and view it in a report.
How would I code the logic in vba to make it work?
Thanks,
Ket
I am new to vba and I need some help with writing the correct syntax for the code to work. Basically I have the following logic:
Code:
strSELECT = "SELECT qryReportBuilderNew.* "
strFROM = "FROM qryReportBuilderNew"
strWHERE = " WHERE qryReportBuilderNew.CompanyID = " & Me.Text10
strSQL = strSELECT & strFROM & strWHERE
CurrentDb.QueryDefs("qryReportBuilderNewTwo").SQL = strSQL
DoCmd.OpenReport "QueryReportOne", acViewPreview
How would I code the logic in vba to make it work?
Thanks,
Ket