I am new to VBA and I'm trying to create a form in Access where a text box is enabled or disabled based on whether a check box is checked or unchecked.
So if the 'Survey Requested?' box is checked the 'Date Survey Requested' box is enabled for the user to enter a date.
I have the following code:
Private Sub CheckSurveyRequested_AfterUpdate()
If CheckSurveyRequested = True Then
DateSurveyReq.Enabled = True
Else
DateSurveyReq.Enabled = False
End If
End Sub
But this comes up with a '424 Object Required' error when I run line 5.
Anyone have a suggestion as to what I'm doing wrong here?
Setkeyword. JustDateSurveyReq.Enabled = False. - jbudDateSurveyReq.Enabled = CheckSurveyRequested.Valueis a nice one-liner to achieve this. - Erik ASetis a typo, I've taken it out but still getting the same error - AlexDateSurveyReq.Enabled = CheckSurveyRequested.Valueinstead? that doesn't seem to be working for me either - AlexElse. Which line do you mean? - Andre