Auto Number mysql

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Simon

    #1

    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

  • Neil

    #2
    Re: Auto Number mysql

    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.Dickson@shos .co.ukwrote in message
    news:1162848915 .186891.265220@ e3g2000cwe.goog legroups.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
    >

    Comment

    • Granny Spitz via AccessMonster.com

      #3
      Re: Auto Number mysql

      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

      Comment

      Working...