Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

case stmt on option group frame not working

Status
Not open for further replies.

leanne123

Technical User
Jun 6, 2008
18
US
I have an option group named fram23. I have 2 options in the frame: IDD185 (1) AND IDD186 (2). When the option IDD185 is selected, I want all cboxxxxx185 to be visible and the cboxxxxxx186 to be invisible. And vice versa. I keep getting this error:

"A problem ocurred while error handling was communicating with the OLEL server or activex control."

Code below:

Private Sub Frame23_AfterUpdate()
Select Case Fram23
Case 1
Me.cboIDOC_YEAR_IDD185.Visible = True
Me.cboIDOC_MONTH_IDD185.Visible = True
Me.cboIDOC_DATE_IDD185.Visible = True

Me.cboIDOC_YEAR_IDD186.Visible = False
Me.cboIDOC_MONTH_IDD186.Visible = False
Me.cboIDOC_MONTH_IDD186.Visible = False
Case 2
Me.cboIDOC_YEAR_IDD186.Visible = True
Me.cboIDOC_MONTH_IDD186.Visible = True
Me.cboIDOC_MONTH_IDD186.Visible = True

Me.cboIDOC_YEAR_IDD185.Visible = False
Me.cboIDOC_MONTH_IDD185.Visible = False
Me.cboIDOC_DATE_IDD185.Visible = False
End If
End Sub
 
I have solved it. Seems I needed the 'me.' in front of the field name in the first select statement:
Private Sub Frame23_Click()

Select Case Me.Frame23
Case 1
Me.cboIDOC_YEAR_IDD185.Visible = True
Me.cboIDOC_MONTH_IDD185.Visible = True
Me.cboIDOC_DATE_IDD185.Visible = True

Me.cboIDOC_YEAR_IDD186.Visible = False
Me.cboIDOC_MONTH_IDD186.Visible = False
Me.cboIDOC_DATE_IDD186.Visible = False

Case 2
Me.cboIDOC_YEAR_IDD186.Visible = True
Me.cboIDOC_MONTH_IDD186.Visible = True
Me.cboIDOC_DATE_IDD186.Visible = True

Me.cboIDOC_YEAR_IDD185.Visible = False
Me.cboIDOC_MONTH_IDD185.Visible = False
Me.cboIDOC_DATE_IDD185.Visible = False
End Select

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top