Auto Number with my SQL
am 07.11.2006 12:53:37 von S.Dickson
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 number
(autonumber) until the form has been saved.
Is there a way on the order form that i can have a button that will
save the data then reopen the form so the order number ( autonumber is
displayed)
I am currently only learning about access so some nice easy instruction
would be very helpful
Thanks
Simon
Re: Auto Number with my SQL
am 08.11.2006 02:07:30 von gordonb.rcgff
>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 number
>(autonumber) until the form has been saved.
MySQL is a database. It doesn't do forms (although there are lots
of things that will do forms and interface to MySQL). And if you
don't try to do a query until the form is filled in and submitted,
MySQL doesn't get involved at all.
>Is there a way on the order form that i can have a button that will
>save the data then reopen the form so the order number ( autonumber is
>displayed)
In MySQL you can have a field in a table like:
id int not null auto_increment,
If you insert null into that field (either by leaving it out of the
field list on an insert, or explicitly inserting null into it),
MySQL will put in the next number in the sequence.
Re: Auto Number with my SQL
am 08.11.2006 20:53:38 von larko
S.Dickson@shos.co.uk wrote:
> 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 number
> (autonumber) until the form has been saved.
>
> Is there a way on the order form that i can have a button that will
> save the data then reopen the form so the order number ( autonumber is
> displayed)
>
> I am currently only learning about access so some nice easy instruction
> would be very helpful
>
>
> Thanks
>
> Simon
>
I think you can use a stored procedure to accomplish this. have the sp
insert an order record in your database table and return the id to the
user. then use the id to display it (or whatever else). finally save all
the data after the user inputs all the other fields.
hope this helps.