Hi,
I need help and I have no experience with recordsets.
I want to update a table after a specific report is printed. The report is generated on a click event. It is based on several tables. The main one has a yes/no field with a default value to yes (checked box). All the records with a value of yes in this field are printed. I actually print 1 enveloppe per record.
After the enveloppes are printed, I want to change the value of the yes/no field to NO (or unchecked).
Here is the
VB code I did:
Dim stDocName As String
Dim db As Database
Dim rec As Recordset
Dim strmsg As String
stDocName = "Enveloppes"
DoCmd.OpenReport stDocName, acNormal
Set db = CurrentDb()
Set rec = db.OpenRecordset("Req_EnveloppesSelection", OpenDynaset)
Do Until rec.EOF
rec.Edit
Print = 0
rec.Update
rec.MoveNext
Loop
rec.Close
For some reason, the table is not updated. I checked if the recordset is updatable (if rec.updatable = true then...) and ran the code step by step. The record is updatable but is not updated. Please help me...
Chantal