NigelShaw
Registered User.
- Local time
- Today, 17:22
- Joined
- Jan 11, 2008
- Messages
- 1,575
Hi,
i seem to be having trouble with adding a record to a recordset. i dont want to open a form so thought it would be just as good to opn a recordset and the info direct. here are my details-
FrmSpGood holds the following from currentloggedOnQry
Username
FirstName
lastName
UserID
and also unbound
DateLog
timeLog
i have placed this code in the onClose-
Dim db As DAO.Database
Dim rst As DAO.Recordset
Set db = db.OpenRecordset("UserLogTbl", dbOpenTable)
rst.AddNew
rst!LoggedInAs = Me.UserName.Value
rst!DateLogged = Me.LoginDate.Value
rst!TimeLogged = Me.TimeStamp
rst!UserID = Me.UserID
rst.Update
Set rst = Nothing
Set db = Nothing
though i do not get any errors, i do not get any data entered into the table.
i tried putting this in OnLoad but i have a progress timer on the form which is started in the OnLoad. it seems that if i place anything else in the OnLoad, the progress doesnt work.
do i have my syntax and placement correct?
regards,
Nigel
i seem to be having trouble with adding a record to a recordset. i dont want to open a form so thought it would be just as good to opn a recordset and the info direct. here are my details-
FrmSpGood holds the following from currentloggedOnQry
Username
FirstName
lastName
UserID
and also unbound
DateLog
timeLog
i have placed this code in the onClose-
Dim db As DAO.Database
Dim rst As DAO.Recordset
Set db = db.OpenRecordset("UserLogTbl", dbOpenTable)
rst.AddNew
rst!LoggedInAs = Me.UserName.Value
rst!DateLogged = Me.LoginDate.Value
rst!TimeLogged = Me.TimeStamp
rst!UserID = Me.UserID
rst.Update
Set rst = Nothing
Set db = Nothing
though i do not get any errors, i do not get any data entered into the table.
i tried putting this in OnLoad but i have a progress timer on the form which is started in the OnLoad. it seems that if i place anything else in the OnLoad, the progress doesnt work.
do i have my syntax and placement correct?
regards,
Nigel