ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   form help!! (https://www.excelbanter.com/excel-discussion-misc-queries/75673-form-help.html)

harpscardiff

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:


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


Bernie Deitrick

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" wrote in message
news:harpscardiff.24av4y_1141735501.3499@excelforu m-nospam.com...

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




harpscardiff

form help!!
 

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


Bernie Deitrick

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



harpscardiff

form help!!
 

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


Bernie Deitrick

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"
wrote in message
news:harpscardiff.24ernb_1141917652.3706@excelforu m-nospam.com...

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




harpscardiff

form help!!
 

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


Bernie Deitrick

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" wrote in message
news:harpscardiff.25shgm_1144237201.2621@excelforu m-nospam.com...

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





All times are GMT +1. The time now is 08:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com