I screwed that up, that's why it was confusing here is my
actual code....
DoCmd.OpenQuery "Scrub_2_Print_Blank_Account_Records",
acViewPreview, acReadOnly
If ????.Scrub_2_Print_Blank_Account_Records.Recordset.Recor
dCount = 0 Then
MsgBox "Scrub 2 is Complete",
vbInformation, "Scrub 2: Fix 'Account' Blanks"
Exit Sub
Else
DoCmd.PrintOut
DoCmd.Close
MsgBox "Retieve List of Blanks from default
Printer", vbInformation, "Scrub 2: Fix 'Account' Blanks"
DoCmd.OpenForm "Make Changes", acNormal
DoCmd.Maximize
End If
I'm using a Query not a Form. What do I use instead
of "Forms" ???
The safest way to do this is to check the query result first, before
even opening the query, and don't bother displaying it unless you have
some results. It might look like this:
'---- start of code ----
Dim strQuery As String
strQuery = "Scrub_2_Print_Blank_Account_Records"
If DCount("*", strQuery) = 0 Then
MsgBox "Scrub 2 is Complete", _
vbInformation, "Scrub 2: Fix 'Account' Blanks"
Exit Sub
Else
DoCmd.OpenQuery strQuery, acViewPreview, acReadOnly
DoCmd.PrintOut
DoCmd.Close acQuery, strQuery
MsgBox "Retieve List of Blanks from default Printer", _
vbInformation, "Scrub 2: Fix 'Account' Blanks"
DoCmd.OpenForm "Make Changes", acNormal
DoCmd.Maximize
End If
'---- end of code ----