Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2003

    Wink Unanswered: lock field depending on data in another field

    Can someone help me with code to lock a field based on another. Let me explain, I have a field called car (yes/no) and a field called car_date. If the car field is no, the car_date is locked and will not allow me to place a date into it and if the car is yes, the car_date will allow me to place a date.

  2. #2
    Join Date
    Nov 2003
    I'm going to assume you are talking about fields on a form and the CarYesNo is a CheckBox on that form and CarDate is a Textbox field on the very same form;

    Place this code into the OnClick event of your CarYesNo CheckBox:

    If Me.CarYesNo.Value = True Then Me.CarDate.Locked = False Else Me.CarDate.Locked = True
    You will also want to place the line of code into the OnCurrent event for your form so that the locking mechanism is carried out as you scroll through records.

    Hope this helps

Posting Permissions

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