Hi, I'm trying to set a tick box on a form so that, if ticked, one text box (SourceOfRequest) will be visible and a number of others invisible, and if not ticked, vice versa.
The code works fine if I'm referring to just one text box (as below) :-
Private Sub StatisticalRequest_AfterUpdate()
If StatisticalRequest = True Then
SourceOfRequest.Visible = True
Else: SourceOfRequest.Visible = False
End If
End Sub
but if I add additional lines such as...
Private Sub StatisticalRequest_AfterUpdate()
If StatisticalRequest = True Then
SourceOfRequest.Visible = True
and MedicalRecordNumber.Visible=False
and Surname.Visible=False...
Else: SourceOfRequest.Visible = False
End If
End Sub
....it's not accepted.
Could you help me with the code please?
Many thanks.
The code works fine if I'm referring to just one text box (as below) :-
Private Sub StatisticalRequest_AfterUpdate()
If StatisticalRequest = True Then
SourceOfRequest.Visible = True
Else: SourceOfRequest.Visible = False
End If
End Sub
but if I add additional lines such as...
Private Sub StatisticalRequest_AfterUpdate()
If StatisticalRequest = True Then
SourceOfRequest.Visible = True
and MedicalRecordNumber.Visible=False
and Surname.Visible=False...
Else: SourceOfRequest.Visible = False
End If
End Sub
....it's not accepted.
Could you help me with the code please?
Many thanks.