My subform consists of a list of tasks that are waiting to be verified. in order to verify tasks, the user scrolls through the list of tasks and checks a checkbox (discrepancyverified) on each record they wish to verify. After the user has finished checking all the records they wish to verify, they click a verify button on the main form which should then go back through each record and update the verifieddate value of any that are checked to today.
This is what I have so far:
It is currently giving the following error:
When i debug, this line is highlighted:
I suspect that I'm messing up the syntax somehow, or perhaps missing something that needs to be included, I'm just not sure what it is.
Any ideas?
Thank you
This is what I have so far:
Code:
Private Sub Command19_Click()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim ctl As Control
Dim varItem As Variant
Set db = CurrentDb()
Set rs = db.OpenRecordset("tblDiscrepancy", dbOpenDynaset, dbAppendOnly)
Set ctl = Forms!frmReviewTracker!subfrmWorkList.Form!discrepancyVerified
For Each varItem In ctl
If ctl.Value = True Then
rs.AddNew
rs!Item = ctl.ItemData(varItem)
rs!VerifiedByDate = Now
rs.Update
End If
Next varItem
MsgBox "Date Updated"
End Sub
It is currently giving the following error:
Run-time error '438':
Object doesn't support this property or method
When i debug, this line is highlighted:
Code:
For Each varItem In ctl
I suspect that I'm messing up the syntax somehow, or perhaps missing something that needs to be included, I'm just not sure what it is.
Any ideas?
Thank you