I print a report several times a day of new internet orders. At present, clicking on a button prints current order. User moves to next new order (if any) and clicks to print again. When order record is printed a field called notes is filled in with date and time pninted. I want to print all records that have not been printed (notes field is blank or null).
example: table - hOrders
do while hOrders.notes is null
print
enddo
This is current form:
Private Sub prtOrder_Click()
On Error GoTo Err_prtOrder_Click
' Revised 6/30/05
' Print single internet order when form 'Homestead Orders' button
' is clicked. Print current record based on report
' settings of report 'CurrentRcdEnv'
Dim stDocName As String
Dim strwhere As String
Dim strNote As String
strNote = " * Printed " & Now() & " *"
Me![comment2] = Me![comment2] & strNote
stDocName = "HomesteadOrdReport"
strwhere = "[inv_no] = " & Me![inv_no]
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.OpenReport stDocName, , , strwhere
Exit_prtOrder_Click:
Exit Sub
Err_prtOrder_Click:
MsgBox Err.Description
Resume Exit_prtOrder_Click
End Sub
david
Start Free Trial