Pass variable from form to form to form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an excel quiz for my classes. From a worksheet, students click a
button to launch a form; After answering a question, they click a next button
to view the next form; Each form has a uniquely named option button that
represents the correct answer. At the end of the last form is the show score
button, which calls a new form to display the percentage correct; How do I go
about passing the score variable? TIA for any suggestions.
 
Hello Headly,

Declare the score variable as Public in a standard VBA Module. The code
in the "Next" form button should update "Score".

Module Code:
Public Score As Single

"Next" button code:
UserForm1.Hide
Score = Score + NumberRight
UserForm2.Show

Sincerely,
Leith Ross
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top