what's wrong with my code

eshai

Registered User.
Local time
Today, 13:55
Joined
Jul 14, 2015
Messages
195
i have a report that i have to print and then marked this report with yes\no field that the record has been printed but my db stack (infinity loop I guess)
my code
Code:
Private Sub btn334_Click()
DoCmd.PrintOut PrintRange:=acPrintAll, PrintQuality:=acHigh, CollateCopies:=True

Dim rst As Recordset
Set rst = CurrentDb.OpenRecordset(Name:="myquery", Type:=RecordsetTypeEnum.dbOpenDynaset)
Do While Not rst.EOF
rst.FindFirst Criteria:=[printed] = "false"

    

   With rst
     .Edit
     ![printed] = "true"
     .Update
   End With
 
      rst.MoveNext
Loop
  
End Sub
 
True should not be a string. It's prob Boolean.

!field = true
 
currentdb.execute "update myquery set printed=true where printed=false"
 

Users who are viewing this thread

Back
Top Bottom