Hi everyone, you've been great in helping me. I have another issue
I have two sets of option button and I am trying to link them together. For example if you choose in set one button one or two, and in set two button 1 to 6, I want to print a specific area of a specific document
Sub OptionButtonExample()
'unload the form in case it was left in memory
Unload formOptionButtons
'display the list until an item is selected or cancel pressed
Do
formOptionButtons.Show
'check value of bOK that was set by the buttons on the form
If Not bOK Then Exit Sub
'if an item is selected, exit the loop after displaying a message
Select Case True
IF Case formOptionButtons.OptionButton1.Value then 'example
MsgBox "you selected button 2up"
Case formOptionButtons.OptionButton3.Value
MsgBox "you selected button 1 2up"
Exit Do
Case formOptionButtons.OptionButton4.Value
MsgBox "you selected button 2 2up"
Exit Do
Case formOptionButtons.OptionButton5.Value
MsgBox "you selected button 3 2up"
Exit Do
Case formOptionButtons.OptionButton6.Value
MsgBox "you selected button 4 2up"
Exit Do
Case formOptionButtons.OptionButton7.Value
MsgBox "you selected button 5 2up"
Exit Do
Case formOptionButtons.OptionButton8.Value
MsgBox "you selected button 6 2up"
Exit Do
elseif (Case formOptionButtons.OptionButton2.Value) then 'example
MsgBox "you selected button 6up"
Case formOptionButtons.OptionButton1.Value
MsgBox "you selected button 1 6up"
Exit Do
Case formOptionButtons.OptionButton2.Value
MsgBox "you selected button 2 6up"
Exit Do
Case formOptionButtons.OptionButton3.Value
MsgBox "you selected button 3 6up"
Exit Do
Case formOptionButtons.OptionButton4.Value
MsgBox "you selected button 4 6up"
Exit Do
Case formOptionButtons.OptionButton5.Value
MsgBox "you selected button 5 6up"
Exit Do
Case formOptionButtons.OptionButton6.Value
MsgBox "you selected button 6 6up"
Exit Do
Case Else
MsgBox "Vous avez pas choisie toute les champs. Veuillez choisir la sorte de carte et le nombre de copie"
End Select
Loop
'remove the form from memory
Unload formOptionButtons
End Sub
In bold is where I am trying to link both sets of option button. Is there someone who have an idea.
thanks in advance
I have two sets of option button and I am trying to link them together. For example if you choose in set one button one or two, and in set two button 1 to 6, I want to print a specific area of a specific document
Sub OptionButtonExample()
'unload the form in case it was left in memory
Unload formOptionButtons
'display the list until an item is selected or cancel pressed
Do
formOptionButtons.Show
'check value of bOK that was set by the buttons on the form
If Not bOK Then Exit Sub
'if an item is selected, exit the loop after displaying a message
Select Case True
IF Case formOptionButtons.OptionButton1.Value then 'example
MsgBox "you selected button 2up"
Case formOptionButtons.OptionButton3.Value
MsgBox "you selected button 1 2up"
Exit Do
Case formOptionButtons.OptionButton4.Value
MsgBox "you selected button 2 2up"
Exit Do
Case formOptionButtons.OptionButton5.Value
MsgBox "you selected button 3 2up"
Exit Do
Case formOptionButtons.OptionButton6.Value
MsgBox "you selected button 4 2up"
Exit Do
Case formOptionButtons.OptionButton7.Value
MsgBox "you selected button 5 2up"
Exit Do
Case formOptionButtons.OptionButton8.Value
MsgBox "you selected button 6 2up"
Exit Do
elseif (Case formOptionButtons.OptionButton2.Value) then 'example
MsgBox "you selected button 6up"
Case formOptionButtons.OptionButton1.Value
MsgBox "you selected button 1 6up"
Exit Do
Case formOptionButtons.OptionButton2.Value
MsgBox "you selected button 2 6up"
Exit Do
Case formOptionButtons.OptionButton3.Value
MsgBox "you selected button 3 6up"
Exit Do
Case formOptionButtons.OptionButton4.Value
MsgBox "you selected button 4 6up"
Exit Do
Case formOptionButtons.OptionButton5.Value
MsgBox "you selected button 5 6up"
Exit Do
Case formOptionButtons.OptionButton6.Value
MsgBox "you selected button 6 6up"
Exit Do
Case Else
MsgBox "Vous avez pas choisie toute les champs. Veuillez choisir la sorte de carte et le nombre de copie"
End Select
Loop
'remove the form from memory
Unload formOptionButtons
End Sub
In bold is where I am trying to link both sets of option button. Is there someone who have an idea.
thanks in advance