megatronixs
Registered User.
- Local time
- Tomorrow, 00:19
- Joined
- Aug 17, 2012
- Messages
- 719
Hi all,
I managed to create some code that will prevent someone from deleting records. It will give message the they are not allowed to deleter records and then it will write to a table the user name, date and time, record ID and team ID.
This works great when it is only one record, but when they select multiple records (from the datasheet view subform), it will only remember the selected one no matter how many they selected.
Is there a way that the below code can be adjusted to catch them all?
Greetings.
I managed to create some code that will prevent someone from deleting records. It will give message the they are not allowed to deleter records and then it will write to a table the user name, date and time, record ID and team ID.
This works great when it is only one record, but when they select multiple records (from the datasheet view subform), it will only remember the selected one no matter how many they selected.
Is there a way that the below code can be adjusted to catch them all?
Code:
Private Sub Form_Delete(Cancel As Integer)
Cancel = True
MsgBox "You are not allowed to delete records."
Dim strSqlrevidcheck As String
Set rst = Nothing
Call GetUserName
user_deleting = GetUserName
DoCmd.SetWarnings False
strSqlrevidcheck = "Insert Into tbl_silent (record_id, user_deleting, date_try_delete, team_id) Values (user_id, GetUserFullName(), Now(), GetUserTeamID())"
DoCmd.RunSQL strSqlrevidcheck
DoCmd.SetWarnings True
End Sub
Greetings.