Results 1 to 4 of 4
  1. #1
    hursan1710 is offline Novice
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2016
    Posts
    10

    Autogenerate Number on a form.

    Hi,

    I have a new customer account form, see bellow, all files will be manually enter and a new entry will be generated on the customer contact table once "Save record" is click, but i want to automatically generate a number by clicking "Generate MailStop" and that number be enter on the MailStop box. this number should start with 7894561 and go from there.
    can anyone help me?




    Click image for larger version. 

Name:	Untitled.png 
Views:	14 
Size:	14.1 KB 
ID:	26361

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Most common is using DMax() and adding 1. Dangerous to put it behind a button if you have multiple users that could be adding customers.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Micron is offline Very Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    You might be OK if you enforce the record to be saved first, then write the generated number to the table whereupon it will display in the control. I agree with pbaldy that to create the number first and put it into the table some time after is not advisable. You would open the form and ensure the generate button is disabled, then enable it after the record saving has taken place.
    Edit:
    as an afterthought, you might want to review information regarding form design with effective placement of controls in mind. Having an action button that comes after a close or cancel button in the visual path is not an example of good design. This page might be of some help http://uxmovement.com/buttons/why-ok...-on-the-right/
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    hursan1710 is offline Novice
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2016
    Posts
    10
    Thank you....

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

Similar Threads

  1. Replies: 5
    Last Post: 11-30-2014, 12:46 PM
  2. Replies: 6
    Last Post: 01-24-2013, 10:02 PM
  3. Open Form from number held in another form
    By systems013 in forum Forms
    Replies: 3
    Last Post: 10-16-2011, 01:48 AM
  4. Replies: 6
    Last Post: 07-25-2011, 01:54 PM
  5. How to autogenerate a project number?
    By Trinity99 in forum Programming
    Replies: 1
    Last Post: 09-20-2009, 02:11 AM

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