I'd be grateful if someone would look at the following for me. I have a database converted from 97 to 2000. I want to check for the presence of records in a table produced by a make table query and if it is empty, abandon ship. This is what I have:
'Check to see if any students in report
Dim rstStudents As Dao.Recordset
Dim dbs As Database
Set dbs = CurrentDb
Set rstStudents = dbs.OpenRecordset("Group for reports")
If rstStudents.RecordCount = 0 Then
MsgBox "No students are in the database for this group", vbOKOnly, "Error"
Else
'Go ahead and merge
Shell "C:\Program Files\Microsoft Office\Office\Winword.exe /mMergeReports", _ vbNormalFocus
End if
Many thanks
Sally
[This message has been edited by Sally (edited 06-07-2002).]
'Check to see if any students in report
Dim rstStudents As Dao.Recordset
Dim dbs As Database
Set dbs = CurrentDb
Set rstStudents = dbs.OpenRecordset("Group for reports")
If rstStudents.RecordCount = 0 Then
MsgBox "No students are in the database for this group", vbOKOnly, "Error"
Else
'Go ahead and merge
Shell "C:\Program Files\Microsoft Office\Office\Winword.exe /mMergeReports", _ vbNormalFocus
End if
Many thanks
Sally
[This message has been edited by Sally (edited 06-07-2002).]