Results 1 to 9 of 9
  1. #1
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,103

    Subform locks table(s)

    Experts:



    I need some assistance with modifying a form/sub-form operation.

    Background:
    - Attached is a **sample** database which contains a few tables AND one main form plus one subform
    - Also, attached are two JPGs which illustrate two different scenarios.

    Scenario #1:
    - Open database
    - Open form “F10_StaffMemberToOffice”
    - In this case, the subform display the data properly

    Scenario #2:
    - Open database
    - Next, open any table (e.g., “T01_Billets”)
    - Then, open form “F10_StaffMemberToOffice”
    - In this scenario, the subform does NOT display any data (i.e., user is getting an error "You tried to lock table... but table cannot be locked because it is currently in use..."

    Here's the underlying issue:
    - This database is utilized by multiple users
    - The form/subform include data from three (3) key tables (organization, billets, staff members).
    - While user #1 may be the only person accessing the form/subform, another user may utilize yet another form which only access, e.g., "T01_Billets".

    My question:
    - How can I potentially modify the form/subform so that other users who access any of these three tables won't have a conflict resulting in the subform not showing data (i.e., locking the tables)?
    Thank you,
    EEH
    Attached Thumbnails Attached Thumbnails Scenario 1 -- Subform displays data.JPG   Scenario 2 -- Subform does NOT display data.JPG  
    Attached Files Attached Files

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    there's no reason to have a subform open in (design mode OR datasheet) AND form mode.

  3. #3
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,103
    ranman256 -- thanks for the prompt response... I'm not fully tracking on your comment. Could you please elaborate? Do I need to change some form properties? If so, which ones?

    Thanks,
    EEH

  4. #4
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Your main form record locks property is set to All Records, which will over-ride your application option to only lock the edited record. Change it to 'edited record' or no locks.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,103
    Micron -- I appreciate your chiming in... please allow me to ask a follow-up question.

    In the form's property (see attached JPG), I see the following properties:
    Allow Additions = Yes
    Allow Deletions = Yes
    Allow Edits = Yes
    Allow Filters = Yes
    Record Locks = No Locks

    Assuming I opened the correct Properties view, which one of these needs to change to "No"? "Allow Edits" only?

    Thanks,
    Tom
    Attached Thumbnails Attached Thumbnails Record Locks.JPG  

  6. #6
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,103
    I changed the "Record Locks" property on the **subform** (vs. main form)… it appears to now work properly. I'll continue testing w/ multiple users. Standing by...


    Definitely very helpful recommendation thus far!!!


    On that note, while other forms don't seem to give me the same error, I'm wondering whether or not I should change this property on all other forms (not included in the sample database).
    It appears the "Record Lock" appears to be the default property when creating a new form. To ensure other others don't run into similar issues, do you advise to change this property to "edited records" across all forms? Or would this result in another unanticipated error?


    Thank you,
    Tom

  7. #7
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Sorry, I mentioned the wrong form. Check subform.

    EDIT - interesting that I didn't see a post that was 18 minutes old. Sometimes I wonder...

  8. #8
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    To ensure other others don't run into similar issues, do you advise to change this property to "edited records" across all forms?
    If anyone had asked me, I would have speculated that the property would default according to what is set in the db options but that is apparently not the case.

    https://support.office.com/en-us/art...7-97fe0568019a

    From what I recall reading elsewhere, record level locking locks a "page" of records. How many records a page might consist of I can't remember. Thus it's my understanding that even record level locking can impose locks on adjacent records, which means the choice of words to define what happens seems somewhat lacking. Best thing you can do is research the subject and then apply what you learn to your specific circumstances. There may be occasions when locking an entire table is safest, or that situation requires no locks. I know developers who remove all locking in their db's as a matter of routine. That might only be to avoid any issues around it but I wonder if they are playing with knives, so to speak.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  9. #9
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,103
    Micron:

    Again, thank you for the great recommendation. I'll double-check w/ the users tomorrow to determine whether or not the change of property (record lock) addresses the issues they recently experienced.

    As previously mentioned, the majority of critical data is maintained across three (3) tables. As of now, we only have about 10 users who simulatanously access the system. Given that each user has a different mission (i.e., one focuses only on civilians while another only focuses on active duty personnel), chances that more than one user accesses the same record is **very** slim.

    So, as long as the forms, queries, and reports won't lock a whole table, I think I should be fine changing the property to "edited records". As you recommended, I'll do little more research on this topic before updating all forms.

    Thank you,
    Tom

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

Similar Threads

  1. Replies: 9
    Last Post: 12-13-2016, 03:06 PM
  2. Replies: 3
    Last Post: 12-10-2016, 06:34 PM
  3. User FE access locks BE
    By khughes46 in forum Access
    Replies: 8
    Last Post: 04-22-2015, 04:07 PM
  4. ASYNC_NETWORK_IO locks on SQL Server
    By cold80 in forum SQL Server
    Replies: 0
    Last Post: 04-03-2015, 09:27 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