Appreciate any help offered.
Check the Number of records of the Query or Table.
'
' Ermittelt die Recordanzahl von Tabellen oder Abfragen
' returns -1 bei Programmfehler
'
Function RecCount(ByVal Objekt As Variant) As Long
On Error GoTo RecCountErr
Dim RS As DAO.Recordset
Dim retc As Long
retc = True
If bTest Then Debug.Print "Function RecCount, Objekt=" & Objekt
Set RS = CurrentDb.OpenRecordset(Objekt, DB_OPEN_SNAPSHOT)
RS.MoveLast
retc = RS.RecordCount
EndRecCount:
On Error Resume Next
RS.Close: Set RS = Nothing
RecCount = retc
Exit Function
RecCountErr:
Resume EndRecCount
End Function
In the Macro condition you should check
RecCount("YourObject")>0
before printing.
Wolfgang
Thanks Wolfgang
I'll give this a try and let you know how I get on.
Cheers