Normal Topic Unique number in Subforms (Read 409 times)
Don Haley
Member
*
Offline


No personal text

Posts: 38
Location: Plymouth, Devon, UK
Joined: Jan 23rd, 2004
Unique number in Subforms
Sep 28th, 2006 at 4:53pm
Print Post Print Post  
I have an Application with several forms one of which is named "CUSTOMERS" which has a subform "EQUIPMENT".  One element in the subform is named "C_No" which I wish to be unique.  I am using the following programming which normally works for me on other forms without any subforms but does not work when I add a record when in table view in "CUSTOMERS".  Is it possible to do what I want?  If so, then what I am doing wrong?

GLOBAL CODE

Stat gsC_No as string

gsC_No = ""



C_No on element exit


var vC_No as String
 
vC_No = C_No
 
If C_No = "" Then  
{
ThrowFocus (Location)
}
Else  
{
NotifyForm(0)
If ((@IsNew) OR (vC_No <> gsC_No)) Then  
{
 If vC_No = @XLU(@FN, C_No, "CUSTOMERS!EQUIPMENT!C_No", "C_No") Then
 {
   
  @MsgBox("This Entry matches an existing entry", vC_No,"Please modify this code OR exit without saving.")
  NotifyForm(1)
 }
}
}


I have tried    If vC_No = @XLU(@FN, C_No, "CUSTOMERS!EQUIPMENT!C_No", "C_No") Then

and               If vC_No = @XLU(@FN, C_No, "EQUIPMENT!C_No", "C_No") Then

Thanks very much

Don
  
Back to top
 
IP Logged
 
Don Haley
Member
*
Offline


No personal text

Posts: 38
Location: Plymouth, Devon, UK
Joined: Jan 23rd, 2004
Re: Unique number in Subforms
Reply #1 - Sep 29th, 2006 at 1:16pm
Print Post Print Post  
Problem solved, reprogrammed from scratch, so it must have been my error.

Don
  
Back to top
 
IP Logged