I'm creating a Logon form for my Access 2013 app and when I enter my password, I get the "you are about to delete... ' warning. The sysUser is a one record table and sysUsers is a linked, one record table. Here's my code:
Private Sub Pswrd_AfterUpdate()
If Me.Pswrd = DLookup("Password", "sysCareUsers", "ContactID = " & Me.UserName.Column(0)) Then
gblUserGroup = DLookup("SecurityLevel", "sysCareUsers", "ContactID = " & Me.UserName.Column(0))
'Save info into sysUser and sysUsers tables
DoCmd.RunSQL ("UPDATE sysUser SET UserID = " & gblUserID)
DoCmd.RunSQL ("UPDATE sysUsers SET UserID = " & gblUserID)
DoCmd.RunSQL ("UPDATE sysUser SET UserGroup = " & gblUserGroup)
MsgBox ("gblUserGroup = " & gblUserGroup)
If gblAction = 0 Then
MsgBox ("The password entered is incorrect. Please try again.")
gblAction = 2
MsgBox ("You not approved as a CARE User. Contact the CARE Administrator.")
These tables contain parameters that are used later in the application. They never contain more that one record, but that record needs to be there.
What do I need to do the keep from getting this warning?