close

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(quot;AS400quot;).Activate
frmsysenq.show ' not sure how to select a tab

End If

End Sub

--------------------Cheers.--
harpscardiff
------------------------------------------------------------------------
harpscardiff's Profile: www.excelforum.com/member.php...oamp;userid=25960
View this thread: www.excelforum.com/showthread...hreadid=519689harpscardiff,

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 MVPquot;harpscardiffquot; gt; wrote in message
news:harpscardiff.24av4y_1141735501.3499@excelforu m-nospam.com...
gt;
gt; Hi,
gt;
gt; I have two forms, 1) asks the user to select either 1, 2, 3, 4 or 5
gt; (radio buttons).
gt;
gt; 2) the second form is questions based on the system they select on the
gt; 1st form, in a form of a multipage.
gt;
gt;
gt; Based on the system they selected, on the first form, I want the form
gt; to select that tab. So if the user selected system 1, the second form
gt; will popup, on the tab system 1.
gt;
gt; I've tried the following:
gt;
gt;
gt; Code:
gt; --------------------
gt;
gt; Private Sub cmdOK6_Click()
gt;
gt; If optAS400 = True Then
gt; ActiveWorkbook.Sheets(quot;AS400quot;).Activate
gt; frmsysenq.show ' not sure how to select a tab
gt;
gt; End If
gt;
gt; End Sub
gt;
gt; --------------------
gt;
gt;
gt; Cheers.
gt;
gt;
gt; --
gt; harpscardiff
gt; ------------------------------------------------------------------------
gt; harpscardiff's Profile: www.excelforum.com/member.php...oamp;userid=25960
gt; View this thread: www.excelforum.com/showthread...hreadid=519689
gt;

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--
harpscardiff
------------------------------------------------------------------------
harpscardiff's Profile: www.excelforum.com/member.php...oamp;userid=25960
View this thread: www.excelforum.com/showthread...hreadid=519689
gt; 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?

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

Bernie
MS Excel MVP

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: www.excelforum.com/member.php...oamp;userid=25960
View this thread: www.excelforum.com/showthread...hreadid=519689Then 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

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

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: www.excelforum.com/member.php...oamp;userid=25960
View this thread: www.excelforum.com/showthread...hreadid=519689harpscardiff,

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 MVPquot;harpscardiffquot; gt; wrote in message
news:harpscardiff.25shgm_1144237201.2621@excelforu m-nospam.com...
gt;
gt; Hi Bernie,
gt;
gt; Sorry for the late reply, was moved to a different project, so could
gt; complete. But i'm back and stil stuck.
gt;
gt; I don't understand what to do, in regards to your last reply.
gt; I'm not sure what some variable should be e.g:
gt;
gt; If frmsysenq.Frame1.optAS400 = True Then SomeVariable = 1
gt; SomeVariable should open the Tab i want? how would I code this?
gt;
gt; Thanks
gt;
gt;
gt; --
gt; harpscardiff
gt; ------------------------------------------------------------------------
gt; harpscardiff's Profile: www.excelforum.com/member.php...oamp;userid=25960
gt; View this thread: www.excelforum.com/showthread...hreadid=519689
gt;

全站熱搜
創作者介紹
創作者 software 的頭像
software

software

software 發表在 痞客邦 留言(0) 人氣()