Normal Topic New number on forms (Read 553 times)
debmckee
Full Member
***
Offline



Posts: 123
Joined: Oct 5th, 2011
New number on forms
Nov 29th, 2011 at 4:53pm
Print Post Print Post  
I am using auto number on one data base so am using the following for another in the same applicaiton.  But it gives me the global number plus 1..........each time!! It doesn't advance to a new number.  my global number is 299 and each form is 300!


var vNextNum as int




If(@IsNew) and @isblank(le1)

   
    {
        vNextNum = @ToNumber(@GlobalValue("NextNumber")) + 1
        le1 = vNextNum
        GlobalValue("NextNumber", @Str(vNextNum))
     GlobalValue("NextNumber","299")

    }
  
Back to top
 
IP Logged
 
debmckee
Full Member
***
Offline



Posts: 123
Joined: Oct 5th, 2011
Re: New number on forms
Reply #1 - Nov 29th, 2011 at 5:24pm
Print Post Print Post  
Ok, I took the  GlobalValue("NextNumber","299")

out and now it works, starting at 300.  Which I assume it is picking up the number from the last saved form.  But how would i change the numbering sequence without mass updating the number on all my records and starting over??
  
Back to top
 
IP Logged
 
Steve_in_Texas
Senior Member
*****
Offline


No personal text

Posts: 893
Location: San Antonio
Joined: Feb 21st, 2004
Re: New number on forms
Reply #2 - Nov 29th, 2011 at 5:25pm
Print Post Print Post  
Remove this line from your code, as it should only be run once to initially set the number to 299.

GlobalValue("NextNumber","299")

  
Back to top
IP Logged
 
debmckee
Full Member
***
Offline



Posts: 123
Joined: Oct 5th, 2011
Re: New number on forms
Reply #3 - Nov 29th, 2011 at 5:30pm
Print Post Print Post  
Thank you!  It worked.  Plus I put command back in and changed my number sequence...saved record and then took command out and all is good.
  
Back to top
 
IP Logged