Results 1 to 10 of 10
  1. #1
    billgyrotech1 is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    May 2019
    Posts
    179

    Initially Lock Certain Fields

    Hello,



    I would like some sort of 2 stage locking in my AFRs Form.

    The Clerk will enter the initial information:

    AFR Number
    SO Number
    Clerk
    Customer
    Description
    Part Number
    Serial Number
    Customer Complaint
    Preliminary Inspection
    Warranty
    Proper ID
    Hidden Damage
    Checked ADs
    Checked SBs

    After these are entered the Clerk will print out a 'Tear Down' Report and those fields should be locked at that point to avoid editing them.

    Can this be done ?

    Also as it is now the combo boxes can't be edited but not sure why.

    The Temperature, Humidity, and Pressure can't be edited either at this point.

    I have a field Status that shows 'Closed' or 'Open'.

    When 'Closed' all of the fields should be locked. This is the next stage of protection.

    Thank you for your help

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Remove the = sign from ControlSource for controls bound directly to fields. = sign causes a calculated value. Calculated values cannot be edited.

    Humidity, Temperature, Pressure are calculated values concatenating text and cannot be edited. Saving calculated result requires code (macro or VBA). Don't use Format() function. Put descriptive text in a label next to textbox. Use Format and DecimalPlaces properties to force display of 2 decimal places.

    Humidity and Temperature and Pressure are set as a Text field in table, make them Number Double.

    Use Conditional Formatting to enable/disable text and combo boxes based on the Status.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    billgyrotech1 is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    May 2019
    Posts
    179
    Thanks I removed the = sign that fixed that part.

    The temp humidity and pressure I reverted back to normal numbers and inserted labels next to them.

    As far as protection maybe a code that can lock certain cells?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Yes, VBA can set Locked property but I encourage you to explore Conditional Formatting first.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    billgyrotech1 is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    May 2019
    Posts
    179
    I am not that familiar with Access.

    Will this formatting work in the case I mentioned? The Clerk will enter the initial information that cannot change unless a mistake was made of course.

    A traveler report 'Tear Down' will stay with the widget and it is important that these fields remain unchanged.

    At that point a Technician will do a repair and fill out all of the other necessary applicable fields.

    Then final reports will be printed out and the entire record (AFR Number is the ID) should be locked from editing.

    Status - Closed

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Conditional Formatting does not require VBA. There are many tutorials. https://www.techrepublic.com/blog/mi...s-and-reports/

    This is basic Access functionality. Have you studied an introductory tutorial book?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    billgyrotech1 is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    May 2019
    Posts
    179
    No I have not studied sort of learning on the fly and also getting valuable help here.

    Before I look into the Conditional Formatting will it do what I asked?

  8. #8
    billgyrotech1 is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    May 2019
    Posts
    179
    I plan to split this database and have different front ends. I can lock certain fields so the technician can't change them. This would be the Technician version.

    I can also lock all fields to be sort of a read only version. This can be viewed by anyone that needs to see the progress of the repair.

    Does that make any sense?

  9. #9
    billgyrotech1 is offline Competent Performer
    Windows 10 Access 2010 64bit
    Join Date
    May 2019
    Posts
    179
    I will mark this as solved and pick back up on Monday.

    Thanks for the help and have a great weekend!

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    You asked if field could be locked based on Status. Yes, that can be done with Conditional Formatting.

    CF can also lock text and combo box based on user permissions. How you get user info and pass that to the CF rule is the trick. But that would have to be resolved even if using VBA. How do you get user permissions? User 'login' and setting permissions is a common topic.

    CF applies only to textboxes and comboboxes, so locking or hiding command buttons or other controls will require VBA.

    Using VBA to set properties will affect ALL instances of control so this is usually not practical for a Continuous or Datasheet form. CF, on the other hand, is dynamic for each record. So if Status is different, each record reflects that when setting control enabled/disabled.

    Different frontends can be maintenance nightmare. I would probably have 1 FE with code to manage what the user can do, unless you don't want to implement a 'login' and user permissions aspect.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Lock fields matching user department
    By jdashm in forum Programming
    Replies: 10
    Last Post: 05-16-2019, 08:10 PM
  2. Lock Fields if Another Field is Not Null
    By PSSMargaret in forum Forms
    Replies: 11
    Last Post: 05-16-2017, 09:22 AM
  3. Fields lock randomly on subform
    By zosta in forum Forms
    Replies: 7
    Last Post: 02-10-2015, 09:24 AM
  4. Automatically Lock Fields
    By Toolman in forum Database Design
    Replies: 2
    Last Post: 05-27-2010, 10:36 AM
  5. Can I lock out fields in a form by keying off...
    By swampdonkey in forum Access
    Replies: 2
    Last Post: 09-07-2006, 07:16 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