tweaked2005
Technical User
I'm using MS Access, and programming in VBA. I have a form, and want the code to run when I open the form, so I've created an event for on Open. I'm using the code below. Baseically, I want it to evaluate each record, and populate my comment field with "new" if the condition is true. This is not working for me, so any help is greatly appreciated.
Code:
Private Sub Form_Open (Cancel As Integer)
Dim db1 As DAO.Database, rcd1 As DAO.Recordset
Set db1 = Current db()
Set rcd1 = db1.OpenRecordset("testTable",dbOpenDynaset)
If Not rcd.EOF Then
If Date - rcd![startDate] < 50 Then
rcd1.Edit
rcd1![Comment/Observation] = "New"
End If
End If
End Sub