help cannot use edit function on recordset

pungentSapling

NeedHotSauce?
Local time
Today, 10:30
Joined
Apr 4, 2002
Messages
115
here is the code. When I run it it says expected variable or function and hihlights on the .Edit part of the code.....Any help would be greatly appreciated..


Sub WriteSyncDate()
Dim db As Database
Dim rsDat As Recordset
Dim varNewDat As Variant
Set db = CurrentDb()
Set rsDat = db.OpenRecordset("Select * from tblSync")
rsDat.MoveFirst
varNewDat = Date
'MsgBox rsDat!syncDate
rsDat.Edit!syncDate = varNewDat
rsDat.Update
Set rsDat = Nothing
Set db = Nothing
End Sub
 
try

rsDat.Edit
rsDat("syncDate") = varNewDat
rsDat.Update

if that doesn't work then there is the long winded method:

rsDat = Currentdb.OpenRecordset("tblSync")
rsDat.MoveFirst
Do
rsDat.Edit
rsDat("SyncDate")=varNewDat
rsDat.Update
rsDat.MoveNext
Loop Until rsDat.EOF = True


HTH
 
thanks that worked great.
 

Users who are viewing this thread

Back
Top Bottom