I have a form the has a number of sections, my users need to check a box for each section that needs to be checked. each section has 4 different options to be completed, that are mandatory.
The form has a submit button. One of the questions that has to be answered is OCRS score,
I have some code im trying to write, so when the submit button is pressed, it will check if the OCRS score has been filled in for any section that has been checked (Has a checkbox ticed)
The code I am trying to do is as follows
This works if I just use the first check, i.e. checkbox 1 and tyres.hide is after the first else, however when the code is as above, I just get an error, "Block If without End If"
I get what this means, that my If statements dont have enough end ifs, but I'm not even sure if I am writing this the corerct way
The form has a submit button. One of the questions that has to be answered is OCRS score,
I have some code im trying to write, so when the submit button is pressed, it will check if the OCRS score has been filled in for any section that has been checked (Has a checkbox ticed)
The code I am trying to do is as follows
VBA Code:
If CheckBox1.Value = True And Me.OCRS_Score1.Value = "" Then
MsgBox ("Please Enter OCRS Score")
Else
If CheckBox2.Value = True And Me.OCRS_Score2.Value = "" Then
MsgBox ("Please Enter OCRS Score")
Else
If CheckBox3.Value = True And Me.OCRS_Score3.Value = "" Then
MsgBox ("Please Enter OCRS Score")
Else
If CheckBox4.Value = True And Me.OCRS_Score4.Value = "" Then
MsgBox ("Please Enter OCRS Score")
Else
tyres.Hide
End If
This works if I just use the first check, i.e. checkbox 1 and tyres.hide is after the first else, however when the code is as above, I just get an error, "Block If without End If"
I get what this means, that my If statements dont have enough end ifs, but I'm not even sure if I am writing this the corerct way