devGarfield
Programmer
Hi All,
I have successfully created a query using CreateQueryDef which is used by my report. The problem is that sometimes there are no records to display. I would like a way to check if there is anything to display within my VBA code, so that I can display a message to the screen.
a snipette of the code is below.
I get an error 'To few paramenters. Expected 2' The strSql is dynamically built based and using controls selected by the user.
Any ideas would be appreciated.
I have successfully created a query using CreateQueryDef which is used by my report. The problem is that sometimes there are no records to display. I would like a way to check if there is anything to display within my VBA code, so that I can display a message to the screen.
a snipette of the code is below.
Code:
Set qdf = db.CreateQueryDef("qryTempLearners", strSql)
Set rs = db.OpenRecordset(strSql)
If (rs.NoMatch) Or rs.RecordCount = 0 Then
MsgBox "No Data"
End If
I get an error 'To few paramenters. Expected 2' The strSql is dynamically built based and using controls selected by the user.
Any ideas would be appreciated.