Hi, hope all is well . I was looking to update a date column in a table and was trying to do it by a button with VBA and seem to have got into a fankle. (ive been messing with python and getting confused now with vba). Im trying to update a column called "PM Due" in a table tblDataLog which contains dates in the format dd/mm/yyyy, by x amount of days and getting the error 424 object required at the line set rst=db.OpenRecordSet(sql), could someone see where im going wrong please, ive added the DAo references which i was initially getting problems with.
thanks for any help
Code:
Private Sub Command0_Click()
Dim sql As String
Dim DQRY As String
Dim data1 As Date
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
sql = "Select * tblDataLog"
Set dbs = CurrentDb
Set rst = db.OpenRecordset(sql)
Do Until rst.EOF
DQRY = "Update " & [PM Due] & " Set ImportDate = DateAdd('d', 6, [PM Due]);"
db.Execute DQRY
rst.MoveNext
Loop
End Sub
thanks for any help