SmartCarFun
Registered User.
- Local time
- Today, 21:39
- Joined
- Feb 17, 2012
- Messages
- 25
Hi,
I have 5 subforms and depending on selection of field [ReturnType] I need to show a subform....
I started with
But then decide to set all subforms to Visible NO and try it this way....
I get a compile error, can anyone see anything obviously wrong with what I'm trying to do?
Thanks All
I have 5 subforms and depending on selection of field [ReturnType] I need to show a subform....
I started with
Code:
Private Sub ReturnType_AfterUpdate()
'After Update of checkbox
'Check if Active checkbox is selected
'then show or hide subform
If Me.ReturnType = "Remittance" Then
Me.Sub_REMIT_Payments.Visible = True
Me.Sub_Returns_F_Clearance.Visible = False
Me.Sub_Returns_F_IHCC.Visible = False
Me.Sub_Returns_F_Reversal.Visible = False
Me.Sub_Returns_F_WriteOff.Visible = False
ElseIf Me.ReturnType = "Clearance" Then
Me.Sub_REMIT_Payments.Visible = False
Me.Sub_Returns_F_Clearance.Visible = True
Me.Sub_Returns_F_IHCC.Visible = False
Me.Sub_Returns_F_Reversal.Visible = False
Me.Sub_Returns_F_WriteOff.Visible = False
ElseIf Me.ReturnType = "IHCC" Then
Me.Sub_REMIT_Payments.Visible = False
Me.Sub_Returns_F_Clearance.Visible = False
Me.Sub_Returns_F_IHCC.Visible = True
Me.Sub_Returns_F_Reversal.Visible = False
Me.Sub_Returns_F_WriteOff.Visible = False
ElseIf Me.ReturnType = "Reversal" Then
Me.Sub_REMIT_Payments.Visible = False
Me.Sub_Returns_F_Clearance.Visible = False
Me.Sub_Returns_F_IHCC.Visible = False
Me.Sub_Returns_F_Reversal.Visible = True
Me.Sub_Returns_F_WriteOff.Visible = False
ElseIf Me.ReturnType = "WriteOff" Then
Me.Sub_REMIT_Payments.Visible = False
Me.Sub_Returns_F_Clearance.Visible = False
Me.Sub_Returns_F_IHCC.Visible = False
Me.Sub_Returns_F_Reversal.Visible = False
Me.Sub_Returns_F_WriteOff.Visible = True
Else
Me.Sub_REMIT_Payments.Visible = False
Me.Sub_Returns_F_Clearance.Visible = False
Me.Sub_Returns_F_IHCC.Visible = False
Me.Sub_Returns_F_Reversal.Visible = False
Me.Sub_Returns_F_WriteOff.Visible = False
End If
End Sub
But then decide to set all subforms to Visible NO and try it this way....
Code:
Private Sub ReturnType_AfterUpdate()
'After Update of checkbox
'Check if Active checkbox is selected
'then show or hide subform
If Me.ReturnType = "Remittance" Then
Me.Sub_REMIT_Payments.Visible = True
ElseIf Me.ReturnType = "Clearance" Then
Me.Sub_Returns_F_Clearance.Visible = True
ElseIf Me.ReturnType = "IHCC" Then
Me.Sub_Returns_F_IHCC.Visible = True
ElseIf Me.ReturnType = "Reversal" Then
Me.Sub_Returns_F_Reversal.Visible = True
Else
Me.Sub_Returns_F_WriteOff.Visible = True
End If
End Sub
I get a compile error, can anyone see anything obviously wrong with what I'm trying to do?
Thanks All