DRathbone
Registered User.
- Local time
- Today, 18:24
- Joined
- Feb 24, 2007
- Messages
- 34
Banging my head againest the wall here playing about with code - this should be simple!
When I run the code it prompts me to enter parameter values - which would say to me its having trouble reading the selected value in my combobox 'cmbdelete' though there is a value present
Code:
Private Sub cmddelete_Click()
Dim db As DAO.Database
Dim rs As DAO.Recordset
messageusr = MsgBox("Delete the selected user '" & cmbdelete & "' ?", vbYesNo + vbExclamation, "Warning you are about to delete the selected user")
If messageusr = vbYes Then
DoCmd.RunSQL ("DELETE * FROM Users WHERE Username = " & cmbdelete.Value & ";")
'Clear fields on form to indicate write has occurred
txtusername = ""
txtpassword = ""
cmbgroup = ""
MsgBox "The user has been successfully Deleted"
End
End If
End Sub
When I run the code it prompts me to enter parameter values - which would say to me its having trouble reading the selected value in my combobox 'cmbdelete' though there is a value present
