Hi,
Does anyone know why this select case isn't working. Case 1 was working fine untill I added case 2 and now even if I comment out case 2 it still doesn't work. I am getting a "Case Without Select case " message. I have a similar setup with another option group on another form with 5 cases and It works ok.
On Error GoTo Command110_Err
Select Case Me.Frameoptions2
Case 1
If Trim(Forms!frmmain!List4 & List8 & "") <> "" Then
DoCmd.OpenReport "rptmonthly", acViewPreview, "", "[fldmonths]=[Forms]![frmmain]![list4] And [U_Unit_Name]=[Forms]![frmmain]![list8]"
Case 2
If Trim(Forms!frmmain!List125 & List8 & "") <> "" Then
DoCmd.OpenReport "rptweekly", acViewPreview, "", "[dateId]=[Forms]![frmmain]![list125] And [U_Unit_Name]=[Forms]![frmmain]![list8]"
End Select
Command110_Exit:
Exit Sub
Command110_Err:
MsgBox Error$
Resume Command110_Exit
End Sub
Does anyone know why this select case isn't working. Case 1 was working fine untill I added case 2 and now even if I comment out case 2 it still doesn't work. I am getting a "Case Without Select case " message. I have a similar setup with another option group on another form with 5 cases and It works ok.
On Error GoTo Command110_Err
Select Case Me.Frameoptions2
Case 1
If Trim(Forms!frmmain!List4 & List8 & "") <> "" Then
DoCmd.OpenReport "rptmonthly", acViewPreview, "", "[fldmonths]=[Forms]![frmmain]![list4] And [U_Unit_Name]=[Forms]![frmmain]![list8]"
Case 2
If Trim(Forms!frmmain!List125 & List8 & "") <> "" Then
DoCmd.OpenReport "rptweekly", acViewPreview, "", "[dateId]=[Forms]![frmmain]![list125] And [U_Unit_Name]=[Forms]![frmmain]![list8]"
End Select
Command110_Exit:
Exit Sub
Command110_Err:
MsgBox Error$
Resume Command110_Exit
End Sub