I want to selectively disable fields containing values within 30 days-- what even to use?

  • Thread starter Thread starter Rachel Garrett
  • Start date Start date
R

Rachel Garrett

I have a form with a drop-down box that allows users to select a
question number and then see the other data fields associated with the
question. This is working. However, I want to *selectively* allow
users to edit only date fields that are further than 30 days out. I
have it "sort of" working:

If [Milestone_1_target_date] < (Date + 30) Then
[Milestone_1_target_date].Enabled = False
End If

The thing is, I don't know what to event to put it under. I tried a
bunch of them. Putting it under Form_Load() makes it only read the
first record. How do I make the code happen to the records that show
up *after* the user selects a value in the combo box?

Thank you so much! I am getting close to finished with this project
for work, and this group has been a great resource.

--Rachel
 
Try putting it in the AfterUpdate event of the combo box. Don't forget to
re-enable those fields that may have been disabled by a previous selection:

If [Milestone_1_target_date] < (Date + 30) Then
[Milestone_1_target_date].Enabled = False
Else
[Milestone_1_target_date].Enabled = True
End If


Carl Rapson
 
Thank you, Carl! This works. I hadn't considered that the control
would stay disabled after I moved to the next record.

--Rachel
 
Back
Top