stevo
07-20-2013, 02:03 AM
how do i write the following access vba After update() code, so when ever a value between 40 and 49, 50 and 60 etc is entered into
txtspeed form field it will display the appiciable txtfine Value for that number. i.e 44 = 350, 55 = 750
The following code works for 40, 50, 60 and 70 but i can't get it to work using the following >= 40 =< 50 as a range value.
Private Sub txtspeed_AfterUpdate()
If txtspeed.Value = 40 Then
txtFine.Value = 350
ElseIf txtspeed.Value = 50 Then
txtFine.Value = 750
ElseIf txtspeed.Value = 60 Then
txtFine.Value = 1000
ElseIf txtspeed.Value = 70 Then
txtFine.Value = 1500
End If
End Sub
txtspeed form field it will display the appiciable txtfine Value for that number. i.e 44 = 350, 55 = 750
The following code works for 40, 50, 60 and 70 but i can't get it to work using the following >= 40 =< 50 as a range value.
Private Sub txtspeed_AfterUpdate()
If txtspeed.Value = 40 Then
txtFine.Value = 350
ElseIf txtspeed.Value = 50 Then
txtFine.Value = 750
ElseIf txtspeed.Value = 60 Then
txtFine.Value = 1000
ElseIf txtspeed.Value = 70 Then
txtFine.Value = 1500
End If
End Sub