+ Reply to Thread
Results 1 to 2 of 2

Pass variable from form to form to form

  1. #1
    headly
    Guest

    Pass variable from form to form to form

    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.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    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

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1