Results 1 to 7 of 7
  1. #1
    Jan Ten is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Dec 2016
    Posts
    3

    Multi user problem


    I have created a multi user access database across 3 computers with a back end and front end.
    My problem is that if 1 user is creating a new record at the same time as another user 1 of them will lose their invoice no.
    I believe there is a way of locking records while they are being worked on.
    How do I approach this problem of 2 users not being able to create a new record at the same time?
    Thanks in advance.

  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,521
    I assume you're creating a custom invoice number? And creating it early on in the process? One solution is to get that number right at the end, as the record is saved (before update event of the form). Another is to save the incomplete record immediately after generating the number, but allow the user to continue entering. Either reduces your chance of a clash to milliseconds. The second is vulnerable to the user changing their mind. There are more robust solutions that are a little more complicated to implement.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Jan Ten is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Dec 2016
    Posts
    3
    Paul.
    I have already the save function a soon as the invoice No has been created and it doesn't appear to fix this problem.
    I would be inserted in more complicated one you mentioned.
    I am conversant with coding and use vba, if that helps.
    Kind Regards


    Jan T Queensland Australia

  4. #4
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,784
    Paul, excuse me for chiming in!
    I have already the save function a soon as the invoice No has been created
    That wasn't the suggestion. The suggestion was to create the number at the END of the process. This is usually the best method. If it cannot be so, (you might need the number to create child records on a sub form) then enforce a save as soon as the record is started while still allowing further data entry/edits. If this also cannot be, say because a user might change their mind and cancel and you cannot allow gaps in the numbers, then trap the error when you are saving the record. What you should do then I can't say because we don't know enough about the process. That is, do you update the number to the next available one?

    One of the more complicated methods inferred might have been to create a temporary value (because child records are required) in temp tables (1 temp table for the main record, 1 for the child records) then update these to the actual value (invoice number) at the time of records saving or form closing and writing the real value to the proper tables. by now, you can probably see why creating the number at the last possible moment is the best method.

    Does each user have their own front end, or do you have only one that is being shared?
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    Jan Ten is offline Novice
    Windows 10 Access 2010 32bit
    Join Date
    Dec 2016
    Posts
    3
    each user has their own front end and the back end is on the server

  6. #6
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,784
    OK. Otherwise, I would have wanted to add a cautionary note about using temp tables in a single shared FE. Most people don't design that way, but if you had, you need a way to deal with one user's temp records without affecting everyone else's.

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Quote Originally Posted by Jan Ten View Post
    I have already the save function a soon as the invoice No has been created and it doesn't appear to fix this problem.
    I'd be curious what that code looks like, as if you get the new invoice number and immediately save the record, clashes should be very minimal. Another option discussed here, using a table:

    http://www.baldyweb.com/CustomAutonumber.htm

    But I've never needed to do it. I've got a commercial reservation program that does.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Problem with Multi'user custom counter code
    By sneuberg in forum Programming
    Replies: 1
    Last Post: 05-09-2015, 09:09 AM
  2. Replies: 2
    Last Post: 10-31-2012, 11:52 AM
  3. Multi-User Access Open Database problem
    By RayMilhon in forum Access
    Replies: 1
    Last Post: 09-25-2012, 04:23 PM
  4. Multi-user problem
    By Reaper in forum Access
    Replies: 3
    Last Post: 12-06-2011, 11:20 AM
  5. Replies: 3
    Last Post: 09-22-2011, 03:35 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