R
Rich
Hello,
I am trying to do some simply data entry on a form. I am entering a
username, firstname and last name. After entering the username, the
Before_Update event fires at which time I check to see if a value already
exists in the table. If it does, pop a message box, then clear the userid
field so that the text box is blank.
Here is the code:
If DCount("Userid", "tblUsers", "[Userid] = Userid") > 0 Then
MsgBox ("This user already exists. Please correct the CDSID.")
frmUsers.UserID = ""
frmUsers.FName = ""
frmUsers.LName = ""
End If
The message box pops OK, then I get "Run-tmie error '424': Object required.
If I use Me.Userid, I get "Compile error: Method or data element not found".
What am I doing wrong, and how can I clear the fields so that data enter can
be corrected and continue?
TIA,
Rich
I am trying to do some simply data entry on a form. I am entering a
username, firstname and last name. After entering the username, the
Before_Update event fires at which time I check to see if a value already
exists in the table. If it does, pop a message box, then clear the userid
field so that the text box is blank.
Here is the code:
If DCount("Userid", "tblUsers", "[Userid] = Userid") > 0 Then
MsgBox ("This user already exists. Please correct the CDSID.")
frmUsers.UserID = ""
frmUsers.FName = ""
frmUsers.LName = ""
End If
The message box pops OK, then I get "Run-tmie error '424': Object required.
If I use Me.Userid, I get "Compile error: Method or data element not found".
What am I doing wrong, and how can I clear the fields so that data enter can
be corrected and continue?
TIA,
Rich