|
-
Oct 24th, 2006, 06:02 PM
#1
Thread Starter
Junior Member
strsql = "Delete..."
Hi,
My code is not deleting the selected record as I wanted to. I think there is something wrong with the line of code, DoCmd.RunSQL ("DELETE FROM UserRole WHERE WindowsUser = " & strDeleteUser)
Any advice will be greatly appreciated!
Private Sub cmdDeleteUser_Click()
Dim Check As Integer
Dim strDeleteUser As String
strDeleteUser = Me.txtFillWindowsUser.Value
Check = MsgBox("Are you sure that you want to delete this user?", vbYesNoCancel)
If Check = vbCancel Then
Cancel = True
ElseIf Check = vbYes Then
DoCmd.RunSQL ("DELETE FROM UserRole WHERE WindowsUser = " & strDeleteUser)
DoCmd.Requery
DoCmd.OpenForm "frmAdmin"
ElseIf Check = vbNo Then
No = True
End If
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|