+ Reply to Thread
Results 1 to 8 of 8

form help!!

  1. #1
    Registered User
    Join Date
    08-05-2005
    Posts
    59

    form help!!

    Hi,

    I have two forms, 1) asks the user to select either 1, 2, 3, 4 or 5 (radio buttons).

    2) the second form is questions based on the system they select on the 1st form, in a form of a multipage.


    Based on the system they selected, on the first form, I want the form to select that tab. So if the user selected system 1, the second form will popup, on the tab system 1.

    I've tried the following:

    Please Login or Register  to view this content.
    Cheers.

  2. #2
    Bernie Deitrick
    Guest

    Re: form help!!

    harpscardiff,

    You set the multiplages value to 1 less than the page you want to show - the pages are 0 based, not
    1 based, so something like

    frmsysenq1.MultiPage1.Value = ValueFromRadioButtons - 1

    will show the correct page

    HTH,
    Bernie
    MS Excel MVP


    "harpscardiff" <[email protected]> wrote in message
    news:[email protected]...
    >
    > Hi,
    >
    > I have two forms, 1) asks the user to select either 1, 2, 3, 4 or 5
    > (radio buttons).
    >
    > 2) the second form is questions based on the system they select on the
    > 1st form, in a form of a multipage.
    >
    >
    > Based on the system they selected, on the first form, I want the form
    > to select that tab. So if the user selected system 1, the second form
    > will popup, on the tab system 1.
    >
    > I've tried the following:
    >
    >
    > Code:
    > --------------------
    >
    > Private Sub cmdOK6_Click()
    >
    > If optAS400 = True Then
    > ActiveWorkbook.Sheets("AS400").Activate
    > frmsysenq.show ' not sure how to select a tab
    >
    > End If
    >
    > End Sub
    >
    > --------------------
    >
    >
    > Cheers.
    >
    >
    > --
    > harpscardiff
    > ------------------------------------------------------------------------
    > harpscardiff's Profile: http://www.excelforum.com/member.php...o&userid=25960
    > View this thread: http://www.excelforum.com/showthread...hreadid=519689
    >




  3. #3
    Registered User
    Join Date
    08-05-2005
    Posts
    59
    Hi Bernie,

    Thanks for your reply. I've tried was you said, but it doesnt work. The 1st form has 5 radio button and a Ok CMD button,

    once the user hits OK, thats when the 2nd form gets displayed.

    frmsysenq1- wont work, as I don't have a form called frmsysenq1
    MultiPage1.Value = ValueFromRadioButtons = replaced with:
    MultiPage1.Value = optAS400 -1 - don't work either....

    frmsysenq1.MultiPage1.Value = ValueFromRadioButtons - 1

    Anything else I can try?

    Thanks

  4. #4
    Bernie Deitrick
    Guest

    Re: form help!!


    > frmsysenq1- wont work, as I don't have a form called frmsysenq1


    I'm sorry - that should have been frmsysenq, since you used:

    frmsysenq.show

    Where are you storing the value from the radio buttons, and how are you
    reading them? They return true/false, so I assume you have code like

    If frmsysenq.Frame.OptionButton1 = True Then SomeVariable = 1
    If frmsysenq.Frame.OptionButton2 = True Then SomeVariable = 2
    If frmsysenq.Frame.OptionButton3 = True Then SomeVariable = 3

    What is the name of the MultiPage?

    > MultiPage1.Value = ValueFromRadioButtons = replaced with:
    > MultiPage1.Value = optAS400 -1 - don't work either...


    Bernie
    MS Excel MVP



  5. #5
    Registered User
    Join Date
    08-05-2005
    Posts
    59
    I'm not storing the value, apart from the the 2nd form, which is being transfered to the spreadsheet, (probably where i'm going wrong?), But basically the initial form links to the 2nd form, based on which option they use, should be the tab which is displayed.

    The multipage is called Multipage one.
    the pages are still called page1 thought to page5
    The information from the 2nd form is dispalyed onto a spreadsheet, once they hit ok.
    There is OK button for each page - transfers data onto spreadsheet.
    There is a Cancel button for each page - hide form
    there is a clear button for each page - clears the values in the form

    thanks

  6. #6
    Bernie Deitrick
    Guest

    Re: form help!!

    Then you need to read the optionbutton values, using code like

    If frmsysenq.Frame.OptionButton1 = True Then SomeVariable = 1
    If frmsysenq.Frame.OptionButton2 = True Then SomeVariable = 2
    If frmsysenq.Frame.OptionButton3 = True Then SomeVariable = 3
    If frmsysenq.Frame.OptionButton4 = True Then SomeVariable = 4
    If frmsysenq.Frame.OptionButton5 = True Then SomeVariable = 5

    and then use SomeVariable to set the multipage's value:

    frmsysenq.MultiPage1.Value = SomeVariable - 1

    Bernie

    "harpscardiff" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > I'm not storing the value, apart from the the 2nd form, which is being
    > transfered to the spreadsheet, (probably where i'm going wrong?), But
    > basically the initial form links to the 2nd form, based on which option
    > they use, should be the tab which is displayed.
    >
    > The multipage is called Multipage one.
    > the pages are still called page1 thought to page5
    > The information from the 2nd form is dispalyed onto a spreadsheet, once
    > they hit ok.
    > There is OK button for each page - transfers data onto spreadsheet.
    > There is a Cancel button for each page - hide form
    > there is a clear button for each page - clears the values in the form
    >
    > thanks
    >
    >
    > --
    > harpscardiff
    > ------------------------------------------------------------------------
    > harpscardiff's Profile:
    > http://www.excelforum.com/member.php...o&userid=25960
    > View this thread: http://www.excelforum.com/showthread...hreadid=519689
    >




  7. #7
    Registered User
    Join Date
    08-05-2005
    Posts
    59
    Hi Bernie,

    Sorry for the late reply, was moved to a different project, so could complete. But i'm back and stil stuck.

    I don't understand what to do, in regards to your last reply.
    I'm not sure what some variable should be e.g:

    If frmsysenq.Frame1.optAS400 = True Then SomeVariable = 1
    SomeVariable should open the Tab i want? how would I code this?

    Thanks

  8. #8
    Bernie Deitrick
    Guest

    Re: form help!!

    harpscardiff,

    Reply to me - take out the spaces and change the dot to . - and I will send you a working example.

    Or post a working address in reply to this message.....

    HTH,
    Bernie
    MS Excel MVP


    "harpscardiff" <[email protected]> wrote in message
    news:[email protected]...
    >
    > Hi Bernie,
    >
    > Sorry for the late reply, was moved to a different project, so could
    > complete. But i'm back and stil stuck.
    >
    > I don't understand what to do, in regards to your last reply.
    > I'm not sure what some variable should be e.g:
    >
    > If frmsysenq.Frame1.optAS400 = True Then SomeVariable = 1
    > SomeVariable should open the Tab i want? how would I code this?
    >
    > Thanks
    >
    >
    > --
    > harpscardiff
    > ------------------------------------------------------------------------
    > harpscardiff's Profile: http://www.excelforum.com/member.php...o&userid=25960
    > View this thread: http://www.excelforum.com/showthread...hreadid=519689
    >




+ 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