Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389


    Quote Originally Posted by Micron View Post
    Unless you have a reason that you must have consecutive numbers, then so what? If you can't have "missing" numbers, then sometimes those records are just saved without data, or flagged as "Rejected" or something that identifies them as being discarded. This can also point out where there may be issues with users using the system haphazardly.

    You might be better off creating any numbers (assuming you can't just use an autonumber) at the end of the process; i.e. open the form without the number, create it upon save. This is usually the best method if the db is used in a shared environment.
    Your suggestion is good but I have seen many sharing database programs made in SQL in many offices in which for example if you are going to make a bill then in that program the bill number is shown first and after that other data entry is feed.
    Suppose at some time, for example, a user creates a bill of number 202 and at the same time on this program (which is shared on another computer) another user also creates a bill of number 202, then now the user who saved first When the user clicks on the button, his data will be saved and the user who later clicks on the save button will be shown an error message.
    "this bill no. already exists"

  2. #17
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by mike60smart View Post
    Hi Deepak

    Main field 1 is the Primary Key set to Autonumber
    Field OrderNumber - Number - LongInteger

    You can then set the Before Update of the Form to use the DMax Function to Add new OrderNumbers
    hi mike,
    According to you this needs to be set in the Before Update event i.e. I was making a mistake by coding in the Form Load event? This means that you and Micron are trying to explain the same thing that the offer number should be generated only after the data entry is completed

  3. #18
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,566
    Yes that's right.

    You can also do it on the AfterUpdate of the OfferDate ie

    If Me Dirty then Me.Dirty = False
    The use the DMax to get the next OfferNumber
    You can PM me if you need further help.
    Good Reading https://docs.microsoft.com/en-gb/off...on-description

  4. #19
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,803
    now the user who saved first When the user clicks on the button, his data will be saved and the user who later clicks on the save button will be shown an error message.
    "this bill no. already exists"
    That does not happen if the number is created at the last moment. Think about it.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #20
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by Micron View Post
    That does not happen if the number is created at the last moment. Think about it.
    ok i'll take care of that....

  6. #21
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by Micron View Post
    That does not happen if the number is created at the last moment. Think about it.
    i refer this question https://www.accessforums.net/showthread.php?t=88729

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Data auto save problem with sub form
    By deepaksharma in forum Access
    Replies: 19
    Last Post: 07-24-2023, 01:21 AM
  2. Replies: 4
    Last Post: 02-15-2016, 09:34 PM
  3. Replies: 6
    Last Post: 01-08-2016, 04:25 PM

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