AfterUpdate question

S

Sher

Listed below is an AfterUpdate that right now if you select LV 3 then
Permanent automatically appears. The problem that the user is having if
someone realizes they made a mistake and change to LV 2 then the Permanent
stays instead of changing to a empty box. Is there something I can do to
change this?


Private Sub LV_AfterUpdate()
On Error GoTo Err_LV_AfterUpdate

'Evaluate the LV control value
If Me.LV = 3 Then
Me.ACCESS.Value = "Permanent"
Else
'Whatever you want if the value is not 3'
End If

Exit_LV_AfterUpdate:
Exit Sub

Err_LV_AfterUpdate:
MsgBox Err.Description
Resume Exit_LV_AfterUpdate

End Sub
 
D

Douglas J. Steele

Whoever gave you that code expected you to put something in place of
'Whatever you want if the value is not 3'

If all you want to do is remove the Permanent, use

Private Sub LV_AfterUpdate()
On Error GoTo Err_LV_AfterUpdate

'Evaluate the LV control value
If Me.LV = 3 Then
Me.ACCESS.Value = "Permanent"
Else
Me.ACCESS.Value = Null
End If

Exit_LV_AfterUpdate:
Exit Sub

Err_LV_AfterUpdate:
MsgBox Err.Description
Resume Exit_LV_AfterUpdate

End Sub
 
S

Steve C

Sher said:
Listed below is an AfterUpdate that right now if you select LV 3 then
Permanent automatically appears. The problem that the user is having if
someone realizes they made a mistake and change to LV 2 then the Permanent
stays instead of changing to a empty box. Is there something I can do to
change this?


Private Sub LV_AfterUpdate()
On Error GoTo Err_LV_AfterUpdate

'Evaluate the LV control value
If Me.LV = 3 Then
Me.ACCESS.Value = "Permanent"
Else
'Whatever you want if the value is not 3'
End If

Exit_LV_AfterUpdate:
Exit Sub

Err_LV_AfterUpdate:
MsgBox Err.Description
Resume Exit_LV_AfterUpdate

End Sub

Hi Sher,

If Me.LV = 3 Then
Me.ACCESS.Value = "Permanent"
Else
'Whatever you want if the value is not 3'
Me.ACCESS.Value = ""
End If

HTH
SteveC
 
S

Sher

Thank you

Steve C said:
Hi Sher,

If Me.LV = 3 Then
Me.ACCESS.Value = "Permanent"
Else
'Whatever you want if the value is not 3'
Me.ACCESS.Value = ""
End If

HTH
SteveC
 
S

Sher

Thank you

Douglas J. Steele said:
Whoever gave you that code expected you to put something in place of
'Whatever you want if the value is not 3'

If all you want to do is remove the Permanent, use

Private Sub LV_AfterUpdate()
On Error GoTo Err_LV_AfterUpdate

'Evaluate the LV control value
If Me.LV = 3 Then
Me.ACCESS.Value = "Permanent"
Else
Me.ACCESS.Value = Null
End If

Exit_LV_AfterUpdate:
Exit Sub

Err_LV_AfterUpdate:
MsgBox Err.Description
Resume Exit_LV_AfterUpdate

End Sub
 
Top