CodeCharge Studio
search Register Login  

Web Reports

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

YesSoftware Forums -> CodeCharge -> Programming

 HELP - Format problem and my brain is frozen

Print topic Send  topic

Author Message
navcan

Posts: 61
Posted: 07/14/2004, 5:26 AM

I am using CC Ver: 2.0.7 (ASP with Templates) and Access Database.

The table has only three fields:

ID - Primary Key (AutoNumber)
CATEGORY – Text Field (Max 3 Characters)
CATCODE – Text Field (Max 7 Characters)

I am trying to combine ID and CATEGORY fields and saving the combined information in CATCODE field by using before Insert or before Update event

FldCATCODE = fldCATEGORY & fldID

It works fine, for example

ID = 2
CATEGORY = DJM
So CATCODE = DJM2

BUT

I want to format the ID with 4 digits like if the ID is 1 format it as 0001, if it is 238, format it as 0238 and then want to have CATCODE = DJM0001, DJM0238, DJM0762 and so on…

The reason to have that format is for making it a standard format for inventory and barcode purpose.

I checked everywhere but could not find an example of vbscript to replace the number with leading zeros

I know in MS Access we can simply format (mask) it as following:

CATCODE=[CATEGORY] & Format([ID],"0000")

When I use the above, I get an error because ASP/VBScript cannot understand Format function.

I know there must be a way to achieve that result but my brain is frozen and I need your help...

Waiting....:-<

regards,
navcan
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.

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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