Results 1 to 4 of 4
  1. #1
    SteveApa is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    84

    Form not read only when it use to be

    Hi All. I just had a user of a frontend backend db tell me that he could edit data in a form - I don't want the user to be able to edit the data in the tabbed subform. This form with a tabbed subform has been read-only for years.
    old code:
    Code:
    DoCmd.OpenForm "4d) ViewModify LZ Start - New Version", , , , acFormReadOnly
    I modified the code to this and it now works as it did before,
    New code:


    Code:
    DoCmd.OpenForm "4d) ViewModify LZ Start - New Version", datamode:=acFormReadOnly
    Anyone have any ideas???

    Thanks
    Steve
    Harrisburg, PA

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    5,008
    Had an office update?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,818
    That person tested with your new syntax and reported that s/he can no longer edit? That would be odd because while the syntax is different, the translation should be the same.
    Note that subforms load first, so check your main form code to ensure that it doesn't undo the subform setting.

    Methinks that locking the subform control OR setting its recordset type to snapshot OR setting the subform AllowEdits property to False would be better. Sometimes vba alters form/window settings that have been set in design view so I wouldn't always rely on those settings.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    SteveApa is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    84
    Yes, the same person tested and was not able to edit after code change.
    I agree... should be the same
    Nothing else changed except for the code I described
    I understand.... and noted.
    Thanks...
    Steve

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

Similar Threads

  1. Read Design & Read Data Issue
    By f15e in forum Access
    Replies: 7
    Last Post: 10-18-2016, 12:44 AM
  2. Replies: 0
    Last Post: 08-26-2013, 12:21 PM
  3. All Textboxes Read-Only on Form
    By cbrsix in forum Programming
    Replies: 5
    Last Post: 04-16-2013, 01:47 PM
  4. form is suddenly read-only
    By Karen H in forum Forms
    Replies: 28
    Last Post: 02-14-2011, 08:38 AM
  5. Replies: 2
    Last Post: 10-19-2006, 04:37 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