Hello,
I have been having issues with some code in my DB. I have drastically changed the functions of the form (this was created by someone who is no longer here, so I am going into this blindly and the majority I think was created in "chunks" ---- Yuk).
I changed the location of the "LastUserUpdated & DateLastModified" fields onto tab view sheets. I also changed the code for the user popup box to confirm data edits. Since then these two functions are not working. Here is the snippet of my code that is giving me errors.
-------------------------- Begin Clip --------------------------
Private Sub DateLastModified_BeforeUpdate(Cancel As Integer)
End Sub
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim Msg As String, Style As Integer, Title As String, DL As String
DL = vbNewLine & vbNewLine
Msg = "You have made changes to this record." & DL & _
"Are you SURE you want to save these changes?"
Style = vbQuestion + vbYesNo
Title = "ACCESS Database - Save Changed Data?"
If MsgBox(Msg, Style, Title) = vbNo Then
Cancel = True
Me.Undo
End If
DateLastModified = Now() 'will show date/time
UserLastUpdated = CurrentUser 'will show user who made a change
End Sub
--------------------------- End Clip ---------------------------
Any help would be appreciated. I am off work the next 4 days, but will check this from home. If you require more code or more information I will post a reply ASAP.
FDBAdmin
Adam W
London, Canada
I have been having issues with some code in my DB. I have drastically changed the functions of the form (this was created by someone who is no longer here, so I am going into this blindly and the majority I think was created in "chunks" ---- Yuk).
I changed the location of the "LastUserUpdated & DateLastModified" fields onto tab view sheets. I also changed the code for the user popup box to confirm data edits. Since then these two functions are not working. Here is the snippet of my code that is giving me errors.
-------------------------- Begin Clip --------------------------
Private Sub DateLastModified_BeforeUpdate(Cancel As Integer)
End Sub
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim Msg As String, Style As Integer, Title As String, DL As String
DL = vbNewLine & vbNewLine
Msg = "You have made changes to this record." & DL & _
"Are you SURE you want to save these changes?"
Style = vbQuestion + vbYesNo
Title = "ACCESS Database - Save Changed Data?"
If MsgBox(Msg, Style, Title) = vbNo Then
Cancel = True
Me.Undo
End If
DateLastModified = Now() 'will show date/time
UserLastUpdated = CurrentUser 'will show user who made a change
End Sub
--------------------------- End Clip ---------------------------
Any help would be appreciated. I am off work the next 4 days, but will check this from home. If you require more code or more information I will post a reply ASAP.
FDBAdmin
Adam W
London, Canada