Hi
I want to printer the ordersheets that have not been printer, but my code keeps printing the same ordersheet ove again as if it does not recognise EOF. What am I doing wrong ?
I have the following code, but replaced the actualt printing with a messagebox, as I have allready printed enough sheets.
---------
CsSQL = "SELECT ORDER_NO,STORE_NO FROM ORDERSBASIC WHERE Printed = False"
Set printchk = CurrentDb.OpenRecordset(CsSQL)
If printchk.EOF Then
Exit Sub
Else
Do While Not printchk.EOF
MsgBox "print" & printchk.ORDER_NO
strWhere = "[ORDER_NO] = '" & printchk.ORDER_NO & "'"
CurrentDb.Execute ("UPDATE ORDERSBASIC SET Printed = True WHERE ORDER_NO ='" & printchk.ORDER_NO & "'")
Loop
-------