This requires 2 clicks to acknowledge:
// Checks to see if employee already exists
var vFullName as String
vFullName = FullName
NotifyForm(0) // Initialize save state
If @IsNew then
{
If vFullName = @XLU(@FN, FullName, "Employee!FullName", "FullName") then
{
NotifyForm(1) // Prevent save
@MsgBox("This Employee record already exists", FullName, "Please modify this record OR exit without saving.")
ThrowFocus(LastName)
}
}
Else
{
NotifyForm(0) //Allow save
ThrowFocus(Address)
}
It must have something to do with the on-element-exit event of Firstname, which is what sets off this event if FullName has changed. I have no programming in LastName.
So the sequence of events is:
* User exits FirstName, FullName is generated
* If FullName matches existing record: saving is initialized, message box comes up, Saving is disallowed.
* Click to acknowledge
* (Something happens that requires another click)
* Message box closes, focus is thrown to LastName
* If FullName is unique or changed back to unique: saving is allowed, focus is thrown to address
It's no big deal, really, at this point...the determination of unique value is working properly and I'm sure the scenario is remote in any case, and since saving is turned off it really doesn't matter where the user goes next because they have to change either the firstname or last name anyway.
Thanks for your help, Ray.