I want to use IF-THEN rules to detect users entering nothing in these forms text box by showing a message box.
but how?... I know how to do a message box, but in oder to run the message box, my program has to detect that the user hasn't entered anything?
please help........... thank you
VB Code:
Private Sub Continue_Click() If IsNumeric(Answer.Text) = True Then 'check for correct data type' MsgBox "You've answered in the wrong data type, please enter in alphabet letters", 1 + 48, "Error" 'message box shown if the user enters their answer in numbers' Else If (Answer.Text = "water") Then 'If correct answer then' Users_score = Users_score + 1 'add one to the score' End If Unload Q1 'closes Question 1 form' Ans_1.Show 'loads Answer and comment form for question 1' End If End Sub 'This code runs when the user has entered their answer in the box provided in the form and clicked OK, it checks if the answer is numbers or not, if so then it will show a message box to the user and if not, then continue the program,, if the answer is correct then add one to the score then closes the question page and load the answer and comment page.'
VB Code:
Private Sub Continue_Click() If IsNumeric(Answer.Text) = True Then 'check for correct data type' MsgBox "You've answered in the wrong data type, please enter in alphabet letters", 1 + 48, "Error" 'message box shown if the user enters their answer in numbers' Else If Not (LCase(Answer.Text) = LCase("East Germany") Or LCase(Answer.Text) = LCase("West Germany") Or LCase(Answer.Text) = LCase("no man's land")) Then 'if the answer is not East Germany, West Germany or no man's land, then add one to the score.' Users_score = Users_score + 1 End If Unload Q4 'closes Question 4 form' Ans_4.Show 'loads Answer and comment form for question 4' End If End Sub 'This code runs when the user has entered their answer in the box provided in the form and clicked OK, it checks if the answer is numbers or not, if so then it will show a message box to the user and if not, then continue the program, close the question page and load the answer and comment page, also if the answer is not East Germany, West Germany or no man's land, then it will add one to the score.'
VB Code:
Private Sub Continue_Click() If IsNumeric(Answer.Text) = True Then 'check for correct data type' MsgBox "You've answered in the wrong data type, please enter in alphabet letters", 1 + 48, "Error" 'message box shown if the user enters their answer in numbers' Else Users_score = Users_score + 1 'add one to the score' Unload Q6 'closes Question 1 form' Finish_page.Show 'loads Answer and comment form for question 1' End If End Sub 'This code runs when the user has entered their answer in the box provided in the form and clicked OK, it checks if the answer is numbers or not, if so then it will show a message box to the user and if not, then continue the program, and add one to the score, closes the question page and load the answer and comment page.'




Reply With Quote