Sandra Smith
asked on
Determine which value is selected in an Excel form option group
I have a form that dynamically presents the user with the required fields to be filled in on an Excel form. When the user saves the data, I first need to validate that the required fields are populated. First the user selects on of the options from an option group, this determines what fields are visiable. So, how do I deterine which option was selected in the group so I can check the data controls? I don't think what I have is the right direction (and it does not work!)
Private Sub btnSave_Click()
Dim intValue As Integer
intValue = Me.fraPortfolioGroup
Select Case intValue
Case Me.optActivePortfolios
If IsNull(Me.txtPortfolioCode) Or IsNull(Me.txtPortfolioName) Or _
IsNull(Me.txtURLSectorSummary) Or IsNull(Me.txtURLSectorDetail) Or _
IsNull(Me.txtURLRatingSummary) Or IsNull(Me.txtURLRatingDetail) Then
Call NullAddProfileMessage
Exit Sub
Case Me.optActiveMiscel
If IsNull(Me.txtPortfolioCode) Or IsNull(Me.txtPortfolioName) Or _
IsNull(Me.txtURLSectorSummary) Or IsNull(Me.txtURLSectorDetail) Then
Call NullAddProfileMessage
Exit Sub
Case Me.optActivePortMastStats
If IsNull(Me.txtPortfolioCode) Or IsNull(Me.txtPortfolioName) Or _
IsNull(Me.txtURLSectorSummary) Then
Call NullAddProfileMessage
Exit Sub
Case Me.optIndexPortfolios
If IsNull(Me.txtPortfolioCode) Or IsNull(Me.txtPortfolioName) Or _
IsNull(Me.txtURLSectorSummary) Or IsNull(Me.txtURLSectorDetail) Or _
IsNull(Me.txtURLRatingSummary) Or IsNull(Me.txtURLRatingDetail) Then
Call NullAddProfileMessage
Exit Sub
Case Me.optIndexMiscel
If IsNull(Me.txtPortfolioCode) Or IsNull(Me.txtPortfolioName) Or _
IsNull(Me.txtURLSectorSummary) Or IsNull(Me.txtURLSectorDetail) Then
Call NullAddProfileMessage
Exit Sub
Case Me.optIndexSFPortfolios
If IsNull(Me.txtPortfolioCode) Or IsNull(Me.txtPortfolioName) Or _
IsNull(Me.txtURLSectorSummary) Or IsNull(Me.txtURLSectorDetail) Then
Call NullAddProfileMessage
Exit Sub
Case Me.optIndexPortMasterStats
If IsNull(Me.txtPortfolioCode) Or IsNull(Me.txtPortfolioName) Or _
IsNull(Me.txtURLSectorSummary) Then
Call NullAddProfileMessage
Exit Sub
End Select
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER