Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    May 2008
    Thanked 0 Times in 0 Posts

    locking a record with a tick box in it (access 200

    Wondering if someone might know the answer.

    In my database each record has a tick box as one field. The form over-lying the table uses this tick box to populate two fields automatically, one is the time and the other the user. How the database is being used is that half the information in each record is entered at the beginning, and then once the rest of the information in the record has been colated the record can then be locked.

    What i want to be able to do is lock the record once the tick box has been ticked. The only option i can find locks the tick box permanently which is not what i want as i have to be able to tick it the once. I am guessing there is a way?

  2. #2
    4 Star Lounger SteveH's Avatar
    Join Date
    Jan 2001
    Chelsea, Gtr London, United Kingdom
    Thanked 0 Times in 0 Posts

    Re: locking a record with a tick box in it (access 200

    In the Current event of your form you want code like;

    Me,chkLock.Enabled = Not Me.LockedYN

    When you move to a record it checks the underlying field's value (LockedYN) (which has a True/False value) and sets the enabled property of the checkbox (named here chkLock) appropriately. If it is not checked your checkbox will be enabled - once it is ticked your checkbox will be locked.

    You may need to do the Locked property of the checkbox as well - I cannot test this at the moment.
    Steve H
    IT Lecturer/Access Developer
    O2K SR3/O2010; Win7Pro

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: locking a record with a tick box in it (access 200

    Another possibility is to set the AllowEdits property of the form:

    Private Sub Form_Current()
    Me.AllowEdits = Not Me.CheckBoxName
    End Sub

    where CheckBoxName is the name of your check box.

Posting Permissions

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