Normal Topic Checking the Number field for Unique Value (Read 376 times)
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Checking the Number field for Unique Value
Feb 18th, 2014 at 8:20pm
Print Post Print Post  
I have an element that is bound to Number field. The value is entered by code and usually it is unique but I want to check when exiting and saving the form to make certain that the fieldvalue is Unique.

On Form Exit Event:

Code
Select All
If @IsUnique (RecNo, @str (RecNo) ) = 0 then
{
    @Msgbox ("Value of RecNo is not Unique", "", "" )
}

 



Even if it is Unique, it throws out message that it is not unique.

  
Back to top
 
IP Logged
 
Bharat_Naik
Senior Member
Members
*****
Offline


Ever ready to learn and
share

Posts: 1202
Location: Chicago,  Illinois
Joined: Dec 16th, 2003
Re: Checking the Number field for Unique Value
Reply #1 - Feb 19th, 2014 at 7:17am
Print Post Print Post  
Nevermind, it works fine. The problem occurred because I was using command @IsUnique ( ) after saving the record, hence giving the wrong result. When I put the command before saving the record, it works as expected.
  
Back to top
 
IP Logged