8
8l2255
Hi,
I have a form with some combo boxes and then some fields. If in the combo
box a SIM card is selected I want the Phone number field to show, but only
for SIM card.
The problem I have is that when I go to next record or previous record the
visibility remains the same from the last cbo update, not as it should be in
the current record.
Private Sub CatIDCBO_Afterupdate()
If CatIDCBO = 2 Then
IMEI.Visible = False
SIMCardNo.Visible = True
SIMPhNo.Visible = True
PlanID.Visible = True
PIN.Visible = True
PUK.Visible = True
ElseIf CatIDCBO = 1 Then
IMEI.Visible = True
SIMCardNo.Visible = False
SIMPhNo.Visible = False
PlanID.Visible = False
PIN.Visible = False
PUK.Visible = False
ElseIf CatIDCBO = 3 Then
IMEI.Visible = True
SIMCardNo.Visible = False
SIMPhNo.Visible = False
PlanID.Visible = False
PIN.Visible = False
PUK.Visible = False
ElseIf Not CatIDCBO And Not 2 And Not 1 Then
IMEI.Visible = False
SIMCardNo.Visible = False
SIMPhNo.Visible = False
PlanID.Visible = False
PIN.Visible = False
PUK.Visible = False
End If
End Sub
I have only just started working with VBA so if there are problems please
let me know.
Thanks!!
I have a form with some combo boxes and then some fields. If in the combo
box a SIM card is selected I want the Phone number field to show, but only
for SIM card.
The problem I have is that when I go to next record or previous record the
visibility remains the same from the last cbo update, not as it should be in
the current record.
Private Sub CatIDCBO_Afterupdate()
If CatIDCBO = 2 Then
IMEI.Visible = False
SIMCardNo.Visible = True
SIMPhNo.Visible = True
PlanID.Visible = True
PIN.Visible = True
PUK.Visible = True
ElseIf CatIDCBO = 1 Then
IMEI.Visible = True
SIMCardNo.Visible = False
SIMPhNo.Visible = False
PlanID.Visible = False
PIN.Visible = False
PUK.Visible = False
ElseIf CatIDCBO = 3 Then
IMEI.Visible = True
SIMCardNo.Visible = False
SIMPhNo.Visible = False
PlanID.Visible = False
PIN.Visible = False
PUK.Visible = False
ElseIf Not CatIDCBO And Not 2 And Not 1 Then
IMEI.Visible = False
SIMCardNo.Visible = False
SIMPhNo.Visible = False
PlanID.Visible = False
PIN.Visible = False
PUK.Visible = False
End If
End Sub
I have only just started working with VBA so if there are problems please
let me know.
Thanks!!