Dec 3, 2006
I am in the process of creating a module to validate a MulitPage UserForm that is composed of, among other controls, multiple frames, each containing a TextBox and two OptionButtons. I need to identify those frames where the TextBox value is not null and neither of the OptionButtons have been selected. The module will pass as variables the TextBox value, OptionButton captions and Frame caption to another module that will create a UserForm with the invalid Frame/TextBox/OptionButtons sets for the user to correct.
View 4 Replies
The interim code listed below runs as a command button on a test UserForm. The MsgBox displays only the first of the OptionButton’s caption as Opt1 and Opt2. Can anyone tell me why and where I went awry?
Public WithEvents As MSforms.TextBox, Opt1 As String, Opt2 As String, vtxt As Long, vFrame As String, vTag As String
Private Sub CommandButton1_Click()
Dim pPage As Page, cCont As Control, vCont As MSforms.Control
'Dim Opt1 As String, Opt2 As String, vtxt As Long, vFrame As String, vTag As String
Is there a more elegant way of accomplishing this? (Control Tags are already spoken for.)