CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 automatic number field with variables

Print topic Send  topic

Author Message
deagon

Posts: 31
Posted: 10/04/2007, 11:08 AM

I'm sure this has been done it can't be that complicated. I have SQL backend with CodeCharge 3.0 . I'm trying to create a Auto number in a JobNum field that will pick up the last number used lets say 4000 and when new data is entered it will select 4001. I've tried if then statements and compare but it is really sloppy. Is there a quick way to auto number a field and then add on the end of the number 4000.i or 4000.r or 4000.2? If I select a new Jobnum for a product and then say I want the same Jobnum but with a add on varible to make this consistant to each Customer? I hope i'm explaining this situation well enough to be understood. I've tried auto increment with prinmary key and that works but my code is not using the ID field for this fuction. I've changed my Jobnum field to primary key and that works but it would create more problems then fix with the code that is already written.

I sure could use your help in a direction to go in.

Thanks,

:-D
View profile  Send private message
Bubba

Posts: 33
Posted: 10/18/2007, 5:52 PM

I have done a similar thing using an Access database.

I created a table called JobnumStart, with one field called Jobnum.

This holds the start number eg: 4000

Then on a Before Show I use this code:


JobnumStart = CCDLookUp("numStart ","[ Jobnum]" DBConnection1)
NewJobnum = JobnumStart + 1

Jobnum = NewJobnum

Now run some code to update the JobnumStart table (numStart ) with the new Jobnum value.

Hope this makes sense.
View profile  Send private message
deagon

Posts: 31
Posted: 10/19/2007, 6:30 AM

Thanks Bubba for your response. It worked like a charm.
View profile  Send private message
Oper


Posts: 1195
Posted: 10/21/2007, 4:02 PM

be aware of this method in a heavy multi user enviroment.
_________________
____________________________
http://www.7bz.com (Free CMS,CRM Developed in CCS)

http://www.PremiumWebTemplate.com
Affiliation Web Site Templates

Please do backup first
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.