C
chris.cot
Guest
Hi, we're a little stuck on this one and was hoping you guys could help us out,
We're trying to update the Last Changed Date and the Last Changed by fields in the View Issue table.
The way we want it to work is, that the user logs into the database, this id is stored and is used to identify who has made changes if they do.
When the user closes the View Issue form, we want it to look at the issue ID look for that issue ID in the issue table, and then update the 2 fields of lastchangeddate and lastchanged by.
Here is the coding that we have tried so far.
Hope someone can help us
Thanks
Private Sub Return_To_Menu_Click()
On Error GoTo Err_Return_To_Menu_Click
Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset("Issue", dbOpenDynaset, dbSeeChanges)
rs.FindFirst ("[IssueID] = '" & Forms![View Issue]![Carl] & "'")
rs.Edit
rs.Fields("LastChangedDate") = Now()
rs.Fields("LastChangedBy") = Forms![Issues Log System]![UserName]
rs.Update
'Set rs = CurrentDb.OpenRecordset("Issue")
'rs.MoveLast
'MyIssueID = rs.Fields("issueID")
DoCmd.Close
We're trying to update the Last Changed Date and the Last Changed by fields in the View Issue table.
The way we want it to work is, that the user logs into the database, this id is stored and is used to identify who has made changes if they do.
When the user closes the View Issue form, we want it to look at the issue ID look for that issue ID in the issue table, and then update the 2 fields of lastchangeddate and lastchanged by.
Here is the coding that we have tried so far.
Hope someone can help us
Thanks
Private Sub Return_To_Menu_Click()
On Error GoTo Err_Return_To_Menu_Click
Dim rs As Recordset
Set rs = CurrentDb.OpenRecordset("Issue", dbOpenDynaset, dbSeeChanges)
rs.FindFirst ("[IssueID] = '" & Forms![View Issue]![Carl] & "'")
rs.Edit
rs.Fields("LastChangedDate") = Now()
rs.Fields("LastChangedBy") = Forms![Issues Log System]![UserName]
rs.Update
'Set rs = CurrentDb.OpenRecordset("Issue")
'rs.MoveLast
'MyIssueID = rs.Fields("issueID")
DoCmd.Close