Math test in VBA – Thank you

15 pts.
Tags:
VBA
Hello :-) I want to create a maths test for my 6 year old daughter. I wish to create a list of questions and she would need to key her answers. If she is gets its correct she gets the "Well done" msgbox otherwise "wrong answer". I've done the following, how can I create a list, whether or not she gets the answer right, how could I move on to another question? Thank you so much!!!!
Sub mathstest()

Dim answer As String
answer = InputBox("What is 2+2?")

If answer = 4 Then

MsgBox ("Well done Sara!")

Else

MsgBox ("Wrong answer!")

End If

End Sub

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • ToddN2000

    This can be done a number of ways. You could have a table with 3 fields, question#,problem,solution. Select from table question 1 and show problem. Loop until she enters the correct answer. On correct answer show message then add 1 to a counter advance to that next question and repeat.  To change thing up you could randomize your counter and retrieve that question number. Doing it his way you can add new math problem to your table without having to change the program.  What is your programming level? What type of data access do you have? Does this all need to be embedded within the application itself?

    11,245 pointsBadges:
    report
  • VBAlearner
    Hi Todd

    Thanks for responding! I'm just a total novice just beginning to explore VBA.
    To answer your questions,

    The data I have is similar to my post, such basic addition, subtraction and multiplication at this stage.I would prefer that all data is embedded within a single module.

    I really appreciate your time and interest in a humble mortal like me!

    Thanks once again

    Ash - UK
    15 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following