Wrox Programmer Forums
|
Access ASP Using ASP with Microsoft Access databases. For Access questions not specific to ASP, please use the Access forum. For more ASP forums, please see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access ASP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 30th, 2003, 03:16 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP and Access AutoNumber

Hi All,

I have an Access database with an AutoNumber field. Now instead of having the number starts off with 1, can I have the format to be something like: B03-001, B03-002, B03-003, and so on.

I have been looking all over the place to do something like this, but so far no luck. What I am working on is an ASP page where I input a customer purchase information. Each time I enter a new customer, the database will automatically (AutoNumber) that particular record. Now the catch is, I want that AutoNumber to start with what I want it to be, instead of 1 and increment. Please Help! If this is not the right place to ask such question, please refer me to an appropriate site. Greatly Appreciated!!! Thank you!!!

Leon

 
Old September 30th, 2003, 11:36 PM
Authorized User
 
Join Date: May 2003
Posts: 62
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Leon,
In the table design view set the format of AutoNumber field as
B03-000.

Bye.


Quote:
quote:Originally posted by phungleon
 Hi All,

I have an Access database with an AutoNumber field. Now instead of having the number starts off with 1, can I have the format to be something like: B03-001, B03-002, B03-003, and so on.

I have been looking all over the place to do something like this, but so far no luck. What I am working on is an ASP page where I input a customer purchase information. Each time I enter a new customer, the database will automatically (AutoNumber) that particular record. Now the catch is, I want that AutoNumber to start with what I want it to be, instead of 1 and increment. Please Help! If this is not the right place to ask such question, please refer me to an appropriate site. Greatly Appreciated!!! Thank you!!!

Leon

Deepesh Jain
VB,VBA & .NET Specialist
Wiley Support Team
 
Old October 10th, 2003, 03:59 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you very much for you help. Wow, that was easy. I have another question and was wondering if you could please help me; it is related to the AutoNumber field as well.

I created an ASP page to UPDATE a record. Please see the Update string below. The problem is, when I click on the update button, instead of updating that record I have set on, it creates a brand new record in the database. Please note, the "referencenumber" is the autonumber field. What am I doing wrong? Thanks again.


SQLstmt = "UPDATE classificationmain SET "
SQLstmt = SQLstmt & "lastname='" & lastname& "',"
SQLstmt = SQLstmt & "incumbentname='" & incumbent & "'"
SQLStmt = SQLStmt & " where referencenumber= " & referencenumber & ""




Quote:
quote:Originally posted by Deepesh_Jain
 Hi Leon,
In the table design view set the format of AutoNumber field as
B03-000.

Bye.


Quote:
quote:Originally posted by phungleon
 Hi All,

I have an Access database with an AutoNumber field. Now instead of having the number starts off with 1, can I have the format to be something like: B03-001, B03-002, B03-003, and so on.

I have been looking all over the place to do something like this, but so far no luck. What I am working on is an ASP page where I input a customer purchase information. Each time I enter a new customer, the database will automatically (AutoNumber) that particular record. Now the catch is, I want that AutoNumber to start with what I want it to be, instead of 1 and increment. Please Help! If this is not the right place to ask such question, please refer me to an appropriate site. Greatly Appreciated!!! Thank you!!!

Leon

Deepesh Jain
VB,VBA & .NET Specialist
Wiley Support Team





Similar Threads
Thread Thread Starter Forum Replies Last Post
AutoNumber in MS Access iii_carlos BOOK: Beginning VB.NET Databases 6 January 31st, 2007 08:23 PM
Autonumber in Microsoft Access ozzii Classic ASP Databases 1 January 17th, 2007 04:08 PM
Accessing AutoNumber field of MS Access Using ASP MuthuAL Classic ASP Databases 1 January 22nd, 2005 11:30 AM
Access Autonumber chall90909 Access ASP 1 November 21st, 2004 10:26 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.