Bullsandbears123
Technical User
How do I update a field within a recordset
my code states I need "edit" when run
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim current As String
Set db = CurrentDb()
Set rst = db.OpenRecordset("mytable"
rst.MoveFirst
'set value in fields
Do While Not rst.EOF
If rst.Fields(1) = DatePart("m", Date) Then
rst.Fields(3).Value = True 'this does not work
Else
rst.Edit.Fields(3).Value = False 'This does not work
End If
rst.MoveNext
Loop
my code states I need "edit" when run
Dim db As DAO.Database
Dim rst As DAO.Recordset
Dim current As String
Set db = CurrentDb()
Set rst = db.OpenRecordset("mytable"
rst.MoveFirst
'set value in fields
Do While Not rst.EOF
If rst.Fields(1) = DatePart("m", Date) Then
rst.Fields(3).Value = True 'this does not work
Else
rst.Edit.Fields(3).Value = False 'This does not work
End If
rst.MoveNext
Loop