Hi,
I've recently had to build a survey in access that people on the phones downstairs will be using. I'm trying to place if statements on the buttons that navigate between tab pages to make sure that questions are not missed out and are filled in correctly. My problem is that as i've got it now, if the page has more than one question on it runs every if statement. I'd like it to end the sub routine on failing an if statement. ie if the first question has been missed or filled in incorrectly, it pops up the message box and doesn't bother checking the rest.
my first attempt went like this:
then my second attempt:
It's still not working as I'd like it to so I'm turning to you guys for help. Any assistance you can give me will be very gratefully received.
Thanks
Wayne
I've recently had to build a survey in access that people on the phones downstairs will be using. I'm trying to place if statements on the buttons that navigate between tab pages to make sure that questions are not missed out and are filled in correctly. My problem is that as i've got it now, if the page has more than one question on it runs every if statement. I'd like it to end the sub routine on failing an if statement. ie if the first question has been missed or filled in incorrectly, it pops up the message box and doesn't bother checking the rest.
my first attempt went like this:
Code:
If Me.Text82.Value > "" Then Me.Q3.SetFocus Else MsgBox "You Must Enter A Date Of Birth!"
If Me.Combo77.Value = "" Then MsgBox "Does The Date Of Birth Match The Data?"
If Me.Combo77.Value = "No" And Me.Text86.Value = "" Then MsgBox "If The Data Doesn't Match, We Require The Date Of Birth"
Me.Q3.SetFocus
End Sub
then my second attempt:
Code:
If Me.Text82.Value = "" Then
MsgBox "You Must Enter A Date Of Birth!"
End Sub
End If
If Me.Combo77.Value = "" Then
MsgBox "Does The Date Of Birth Match The Data?"
End Sub
End If
If Me.Combo77.Value = "no" And Me.Text86.Value = "" Then
MsgBox "If The Date Of Birth Does Not Match, We Require An Actual Age!"
End Sub
End If
Me.Q3.SetFocus
End Sub
It's still not working as I'd like it to so I'm turning to you guys for help. Any assistance you can give me will be very gratefully received.
Thanks
Wayne