Hi there,
I have a tutorial history form which allows tutors to view their tutorials and delete any that were created in error.
The trouble is, at the moment my delete code allows users to delete any tutor records when really it should just be there own.
How can I validate the user so that only the current user of the database can delete their particular records only and no others?
I have a login screen which requires the user to select their name from a combo box and then the system checks their selection against the PC username, if this matches then they can enter the system.
So I have the username available as a variable I just don't know how to write a routine for this.
I have a tutorial history form which allows tutors to view their tutorials and delete any that were created in error.
The trouble is, at the moment my delete code allows users to delete any tutor records when really it should just be there own.
Code:
If MsgBox("Are you sure you want to delete this record?", vbYesNo, _
"Confirmation Required") = vbNo Then
'SendKeys "~"
Exit Sub
End If
On Error Resume Next
DoCmd.RunSQL ("DELETE * FROM [tbl_Tutorial] WHERE " _
& "(([tbl_Tutorial].[TutorialNo])=" & Me!List14.Column(0) & ")")
List14.Requery
How can I validate the user so that only the current user of the database can delete their particular records only and no others?
I have a login screen which requires the user to select their name from a combo box and then the system checks their selection against the PC username, if this matches then they can enter the system.
So I have the username available as a variable I just don't know how to write a routine for this.