J
Jeff
Goal:
Run a query and count the resulting records. If the
resulting records = 0, then I simply want a message box to
pop up, however, it the records are > 0, then I want to
print the results. Below is the code I have attempted to
write, however, I do not think it is counting the
resulting records as the message box pops up when the
records are > 0. Please help!
Sub Duplicates()
Dim stDocName5 As String
stDocName5 = "15th_Find Dups in Terms and Changes with
Point Loss Tbl"
DoCmd.OpenQuery stDocName5
If RecordCount = 0 Then
MsgBox "No Duplicates Found"
Else: DoCmd.PrintOut stDocName5, acPrintAll
End If
End Sub
Run a query and count the resulting records. If the
resulting records = 0, then I simply want a message box to
pop up, however, it the records are > 0, then I want to
print the results. Below is the code I have attempted to
write, however, I do not think it is counting the
resulting records as the message box pops up when the
records are > 0. Please help!
Sub Duplicates()
Dim stDocName5 As String
stDocName5 = "15th_Find Dups in Terms and Changes with
Point Loss Tbl"
DoCmd.OpenQuery stDocName5
If RecordCount = 0 Then
MsgBox "No Duplicates Found"
Else: DoCmd.PrintOut stDocName5, acPrintAll
End If
End Sub