Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2009
    Posts
    47

    Unanswered: Locking Parts of Forms

    I have a database with forms. Inside of the forms I have multiple subforms that I use with specific queries on each so that I can choose which users (from a user group) have access to modify the records by using Users and Permissions. It is an mdb using Access 2003.

    Now these subforms work but is there a way that I can have only one form that locks down the database? The subforms have recently become quite crowded on the form and are beginning to look rather unappealing.

    So, what I would need is, for example, would be the Admins group to be able to edit everything but the Teachers group to only be able to edit the comments about the student while other groups could edit things like what grade they are in etc.

    Is there a good way to do this or do I just have to stick with the subforms? I have thought about just giving them what they can edit but everyone needs read access to the database to see everything but should only have write access to a few things.

    Thanks

  2. #2
    Join Date
    May 2010
    Posts
    601
    It is possible to set the Locked Property of a sub form control to make it read only.

    Me.SubFormControlName.Locked = True

    I would use the Form's On Current event to lock down the records based on your security model.
    Boyd Trimmell aka HiTechCoach HiTechCoach.com (free access stuff)
    Microsoft MVP - Access Expert
    BPM/Accounting Systems/Inventory Control/CRM
    Programming: Nine different ways to do it right, a thousand ways to do it wrong.
    Binary--it's as easy as 1-10-11

  3. #3
    Join Date
    Jul 2009
    Posts
    47
    Right, I already know about how to lock the subform but I am trying to get away from the subforms all together. The reason is I have the last name of the student in the same table as their grade. To get it so that only the grade can be changed by Teachers - using Users and Groups - I have to create a subform with a query that only returns grade then use another subform to return the last name so that Admins can edit the last name if they need to.

    What I am asking is can I get rid of the subforms all together so that everything looks cleaner, but still be able to choose what group can edit what part of the form? I can't just lock fields using the Lock Property due to some groups needing different editing rights to the database.

    It's a SQL backend also if that changes anything.

  4. #4
    Join Date
    May 2010
    Posts
    601
    Quote Originally Posted by apurgert View Post
    Right, I already know about how to lock the subform but I am trying to get away from the subforms all together. The reason is I have the last name of the student in the same table as their grade. To get it so that only the grade can be changed by Teachers - using Users and Groups - I have to create a subform with a query that only returns grade then use another subform to return the last name so that Admins can edit the last name if they need to.

    What I am asking is can I get rid of the subforms all together so that everything looks cleaner, but still be able to choose what group can edit what part of the form? I can't just lock fields using the Lock Property due to some groups needing different editing rights to the database.

    It's a SQL backend also if that changes anything.
    Why two sub forms? Why not just one sub form and lock the controls by user?


    It also sounds like you have some design issues that violate the rules of data normalization. With a different design of the table structures that i s properly normalized, this would be very easy and would have eliminated your issues.

    If at all possible, I would recommend considering take a look at the table structure to see if there are any areas for improvement. It will probably resolve this issue and many future issues.
    Boyd Trimmell aka HiTechCoach HiTechCoach.com (free access stuff)
    Microsoft MVP - Access Expert
    BPM/Accounting Systems/Inventory Control/CRM
    Programming: Nine different ways to do it right, a thousand ways to do it wrong.
    Binary--it's as easy as 1-10-11

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •