I'm trying to have a page automatically print every 10 seconds when there are results. The 10 second timer is good, the report and print is good, but when I try to print it via VB, it gives the error "this action cannot be carried out while processing a form or report event" and highlights the DoCmd.PrintOut line
Code:
Private Sub Form_Timer()
DoCmd.SetWarnings False
Dim db As DAO.Database
Dim rs As Recordset
Dim ssql As String
Set db = CurrentDb()
ssql = "SELECT Mfg, CustName, PONumber, OrderNum, PartID, Inspect, ReceivedID, PrintLocation, PrintQty, Part FROM ReceivingPrintTemp"
Set rs = db.OpenRecordset(ssql, dbOpenSnapshot, dbSeeChanges)
Do While Not rs.EOF
DoCmd.PrintOut , , , , 3
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
dbc.Close
Set dbc = Nothing
DoCmd.SetWarnings True
End Sub