On a form, when accepting an Insert, I look into another file to see if a specific email address has been used before. If so, I display an Alert warning to the user, that the email has been used. I then return to the form, but it is no longer responsive. That is, the Save button does not work, all I can do is cancel. Here is my code, in the Validate, Insert, End embed:
If loc:Create_Login_Account = 1
Usr:EMail = Phys:Physician_EMail_Address
If Access:Users.Fetch(Usr:EMail_key) = Level:Benign !check to see if account already exists
!message that account exits
p_web.Script('alert("Account(Email address) already exists!");')
Return('')
ELSE
Usr:Institution_ID = Phys:Institution_ID
Usr:Last_Name = Phys:Physician_Last_Name
Usr:First_Name = Phys:Physician_First_Name
Usr:MI = Phys:Physician_Middle_Initial
Usr:Level = 50
Usr:Salt = st.Random(8,st:upper)
Usr:Password = st.Random(8,st:upper)
Usr:EMail = Phys:Physician_EMail_Address
Usr:ForcePasswordChange = 1
Access:Users.Insert()
!!loc vars for email control here
END!IF
END
I'm not sure I'm using Return correctly. Any suggestions?
Thanks,
Jeff King