473,387 Members | 1,749 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Auto Number mysql

I had an access database that i use as an ordering system. I have a
form for entering customer details. When i add a new customer on the
form the customer number is an auto number that appears when i type in
the details.
I have just moved over to mysql server with access as the front end. I
have setup the sql tables with the customer number as autonumber.

When i go into the form and add a new customer it does not generate the
customer Number automaticaly on the form like it did before. once i
have entered all the data and saved it i went into the customer table
to see if the data was saved the auto number was in there .

Is there any way for on the form for the autonumber to be displayed
when i start entering the data. Like how it was when i used access as
the back end before i moved to mysql as the back end
Any help would be great

Simon

Nov 6 '06 #1
2 2165
I use SQL Server, but I believe the principle is the same. You won't get the
autonumber value until the record is saved. Since it's not generated by Jet,
Jet can't anticipate what its value will be, and can't display it until it
gets it from the back end engine.

One thing you can do as a workaround is to create the record first, and then
bring the user into it. In other words, instead of just going to a new
record, create a new record in code, get that autonumber value, requery the
form, and then go to the new record for the users to input the other fields.
The users might not like that, as they might just be used to going to the
"new" record; but it may be the way you need to do it if you want to display
the number before the record is edited and saved by the user.

Or, if the issue is that the users are getting confused by there not being a
number, then simply hide or disable that field until a value appears in it,
or something to that effect.

"Simon" <S.*******@shos.co.ukwrote in message
news:11**********************@e3g2000cwe.googlegro ups.com...
>I had an access database that i use as an ordering system. I have a
form for entering customer details. When i add a new customer on the
form the customer number is an auto number that appears when i type in
the details.
I have just moved over to mysql server with access as the front end. I
have setup the sql tables with the customer number as autonumber.

When i go into the form and add a new customer it does not generate the
customer Number automaticaly on the form like it did before. once i
have entered all the data and saved it i went into the customer table
to see if the data was saved the auto number was in there .

Is there any way for on the form for the autonumber to be displayed
when i start entering the data. Like how it was when i used access as
the back end before i moved to mysql as the back end
Any help would be great

Simon

Nov 7 '06 #2
Simon wrote:
Is there any way for on the form for the autonumber to be displayed
when i start entering the data. Like how it was when i used access as
the back end before i moved to mysql as the back end
Jet creates a new autonumber when the new record is created, but MySQL
creates this number when the new record is committed. If you want to see
this new number, you need to save the record first so it's assigned to this
record. You may be able to bookmark the record and move back to it with the
recordsetclone after you save the record, but I've never done this myself
because it's always hidden on my forms when I use an autonumber column. It's
entirely irrelevant and my users don't need to see it.

--
Message posted via http://www.accessmonster.com

Nov 7 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Sims | last post by:
Hi, I have a table that give a unique ID to certain Articles. To give the ID i simply use the Auto count of the DB. But what happens when i delete a record? i am now missing an ID. How can i...
0
by: TheMechE | last post by:
Has anyone had a table that has lived long enough to wrap the auto incrementing number...? i.e. the complete byte span and back to 0x32. I'm just wondering if mySql will fill in the deleted ID's...
12
by: Nick | last post by:
Is it possible to have multiple auto increments in one column? Say I have two tables... 1. table 'messageboards' with fields ('id' , 'name') 2. table 'messagethreads' with fields ('id' ,...
3
by: Smitro | last post by:
Hey, I have a site that is about to go into production and it has a couple of tables that it uses that could get quite large once in full swing, most of them have a column called "id" and it...
2
by: x0054 | last post by:
Ok, this is a stupid problem, I admit. I have a scrip that adds records to a table. The records are for photos. So, after adding a record the scrip also uploads a picture from users computer and...
1
by: daniellee2006 | last post by:
I am creating a basic website to store people profiles and within this website i have a page that creates a table dependent on the number of records in mysql written in PHP within these tables...
13
by: S.Dickson | last post by:
I had an access database that i use as an ordering system. I have a form for entering customer details. When i add a new customer on the form the customer number is an auto number that appears when...
2
by: S.Dickson | last post by:
I have just moved over to mysql as the back end and keeping access as front end. My database is for a ordering system. I use autonumber as the Order Number. as mysql does not display the order...
0
by: Tom | last post by:
I'm using the DB_DataObject script createTables.php to auto-generate the necessary database schema on two databases. Using the .ini approach (not the in-line PHP approach) to configure...
1
by: cool84 | last post by:
hai, 1. i need help on how to set the auto incremental as "REF0001","REF002","REF003",.......and so on. 2. i declare the field as integer but i want the prefix "REF" follow by the ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.