I'm working on a multi-sheet Workbook Print Application for the Shop floor users. As one would expect, there are several printing options presented. I've taken care of the simpler options with few problems. I'm stumped as to how to handle a multi Option Button VBA UserForm.
Here's the scenario:
A UserForm (WbkSheets1) pops up with 4 options. This box is intended to ask the user which Workbook sheet they would like to print. The 4 options represent the 4 Worksheets in the Workbook. The Option buttons are named DWGRev1, Dwg2, Traveler3, and Squawk4.
If the user selects DWGRev1 or Traveler3, they are printed immediately. If the user selects Dwg2 or Squawk4, a Serial Number is required before printing.
To have the user supply the Serial Number they wish to print, I created VBA UserForm OtherSingleSN1 with a TextBox (EnterSNSingle1) and OK and Cancel command buttons. Here's the code for the OtherSingleSN1 box:
I'm want to retain the value of OptionButton Dwg2 along with User-entered Serial Number and pass them on to the appropriate printing procedure. The variable frm.Dwg2.Value always returns FALSE. The variable intBegSN is a value for the user-supplied Serial Number passed to the printing procedures.
I've tried so many approaches, the code may be totally screwed up and unworkable. The idea is to go from the UserForm WbkSheets1, when Dwg2 or Squawk4 are selected, supply a Serial Number, then print whichever page was selected with the supplied Serial Number. A little sage wisdom would be greatly appreciated
Here's the scenario:
A UserForm (WbkSheets1) pops up with 4 options. This box is intended to ask the user which Workbook sheet they would like to print. The 4 options represent the 4 Worksheets in the Workbook. The Option buttons are named DWGRev1, Dwg2, Traveler3, and Squawk4.
If the user selects DWGRev1 or Traveler3, they are printed immediately. If the user selects Dwg2 or Squawk4, a Serial Number is required before printing.
To have the user supply the Serial Number they wish to print, I created VBA UserForm OtherSingleSN1 with a TextBox (EnterSNSingle1) and OK and Cancel command buttons. Here's the code for the OtherSingleSN1 box:
Code:
Private Sub SNSingleOK1_Click()
Unload Me
Dim frm As New WbkSheets1
Dim intBegSN As String
Debug.Print frm.Dwg2.Value
If frm.Dwg2.Value = True Then
Call PrintDwg
ElseIf frm.Squawk4.Value = True Then
Call PrintSquawk
End If
intBegSN = EnterSNSingle1.Value
Debug.Print EnterSNSingle1.Value
End Sub
I've tried so many approaches, the code may be totally screwed up and unworkable. The idea is to go from the UserForm WbkSheets1, when Dwg2 or Squawk4 are selected, supply a Serial Number, then print whichever page was selected with the supplied Serial Number. A little sage wisdom would be greatly appreciated