Results 1 to 8 of 8
  1. #1
    magj is offline Novice
    Windows XP Access 2003
    Join Date
    Apr 2012
    Posts
    4

    Create autonumber button in form - tables ready


    Hi,

    I have a form to add new records to a table(s), which have already the autonumber field.
    All I want to do is to create a button in the form that generates and shows the autonumber of the new record being added.

    I have zero experience in VBA. I have already googled a lot, but couldnīt get to anything.

    Thank you in advance.

  2. #2
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    If your form is bound to the table, Access will automatically generate the autonumber field's value when you start entering data into one of the other controls on the form. You would need to include a textbox control on the form for the autonumber field in order to see the value.

  3. #3
    magj is offline Novice
    Windows XP Access 2003
    Join Date
    Apr 2012
    Posts
    4
    Thank you.

  4. #4
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    You are welcome.

  5. #5
    magj is offline Novice
    Windows XP Access 2003
    Join Date
    Apr 2012
    Posts
    4
    Another simple thing. I noticed I wonīt be able to save the new record if the auto-number has not been generated yet.
    And in this template which I am adapting, I want, therefore, to configure a button to generate the autonumber, which is then shown in the textbox I created.
    I have been trying hard to find something I can understand..
    Can you give a hint?

    Thanks

  6. #6
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    Another simple thing. I noticed I wonīt be able to save the new record if the auto-number has not been generated yet.
    I'm not sure I follow. The autonumber value should show as soon as you start entering data in any other control on the form. The record is not saved with that autonumber value until either the user has tabbed through all the controls on the form or until one of the record navigation buttons has been clicked (forces a save of the current record). Are you trying to create new records without any data except the autonumber? If so, why?

  7. #7
    magj is offline Novice
    Windows XP Access 2003
    Join Date
    Apr 2012
    Posts
    4
    Ok. It seems the problem is that the autonumber is not generated when I click the new record button and start filling the several fields.

  8. #8
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    It should be, so something else is going on. Can you zip and post your database (with any sensitive data removed or altered)?

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 30
    Last Post: 01-16-2012, 05:49 PM
  2. CREATE TABLE and AutoNumber fields
    By JTeagle in forum Queries
    Replies: 1
    Last Post: 11-10-2011, 03:31 AM
  3. Create a form using 3 tables
    By Mrdudecool in forum Forms
    Replies: 1
    Last Post: 01-20-2011, 01:43 PM
  4. Replies: 7
    Last Post: 01-12-2011, 01:41 PM
  5. Create an RDP link button on my form
    By BDP in forum Access
    Replies: 1
    Last Post: 09-14-2010, 02:49 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums