S
stockwell43
Hello,
I have some code behind a form. What I want to do is set it up so if the
user enters a Property Code other than what I coded, I want a message to pop
up saying "Incoorect Property Code". For some reason mine doesn't work. When
I enter a code that is not coded it accepts it and does nothing. Here is the
Code:
Private Sub CollateralCode_AfterUpdate()
'Field named Property Code
On Error GoTo EH
If Me.CollateralCode = "17" Then
Me.Rate = "0.0833"
ElseIf Me.CollateralCode = "18" Then
Me.Rate = "0.0833"
ElseIf Me.CollateralCode = "30" Then
Me.Rate = "0.0833"
ElseIf Me.CollateralCode = "41" Then
Me.Rate = "0.1000"
ElseIf Me.CollateralCode = "42" Then
Me.Rate = "0.1000"
ElseIf Me.CollateralCode = "43" Then
Me.Rate = "0.1000"
ElseIf Me.CollateralCode = "44" Then
Me.Rate = "0.1000"
ElseIf Me.CollateralCode = "45" Then
Me.Rate = "0.1000"
ElseIf Me.CollateralCode = "47" Then
Me.Rate = "0.1000"
ElseIf Me.CollateralCode = "48" Then
Me.Rate = "0.1000"
ElseIf Me.CollateralCode = "49" Then
Me.Rate = "0.1000"
ElseIf Me.CollateralCode = "50" Then
Me.Rate = "0.1000"
ElseIf Me.CollateralCode = "51" Then
Me.Rate = "0.1000"
ElseIf Me.CollateralCode = "52" Then
Me.Rate = "0.1000"
ElseIf Me.CollateralCode = "55" Then
Me.Rate = "0.1000"
ElseIf Me.CollateralCode = "56" Then
Me.Rate = "0.1000"
ElseIf Me.CollateralCode = "57" Then
Me.Rate = "0.1000"
ElseIf Me.CollateralCode = "58" Then
Me.Rate = "0.1000"
ElseIf Me.CollateralCode = "59" Then
Me.Rate = "0.1000"
Else
EH:
If Err.Number = 2501 Then
MsgBox "Incorrect Property Code"
End If
End If
End Sub
Any help would be most appreciated.
Thanks!!!
I have some code behind a form. What I want to do is set it up so if the
user enters a Property Code other than what I coded, I want a message to pop
up saying "Incoorect Property Code". For some reason mine doesn't work. When
I enter a code that is not coded it accepts it and does nothing. Here is the
Code:
Private Sub CollateralCode_AfterUpdate()
'Field named Property Code
On Error GoTo EH
If Me.CollateralCode = "17" Then
Me.Rate = "0.0833"
ElseIf Me.CollateralCode = "18" Then
Me.Rate = "0.0833"
ElseIf Me.CollateralCode = "30" Then
Me.Rate = "0.0833"
ElseIf Me.CollateralCode = "41" Then
Me.Rate = "0.1000"
ElseIf Me.CollateralCode = "42" Then
Me.Rate = "0.1000"
ElseIf Me.CollateralCode = "43" Then
Me.Rate = "0.1000"
ElseIf Me.CollateralCode = "44" Then
Me.Rate = "0.1000"
ElseIf Me.CollateralCode = "45" Then
Me.Rate = "0.1000"
ElseIf Me.CollateralCode = "47" Then
Me.Rate = "0.1000"
ElseIf Me.CollateralCode = "48" Then
Me.Rate = "0.1000"
ElseIf Me.CollateralCode = "49" Then
Me.Rate = "0.1000"
ElseIf Me.CollateralCode = "50" Then
Me.Rate = "0.1000"
ElseIf Me.CollateralCode = "51" Then
Me.Rate = "0.1000"
ElseIf Me.CollateralCode = "52" Then
Me.Rate = "0.1000"
ElseIf Me.CollateralCode = "55" Then
Me.Rate = "0.1000"
ElseIf Me.CollateralCode = "56" Then
Me.Rate = "0.1000"
ElseIf Me.CollateralCode = "57" Then
Me.Rate = "0.1000"
ElseIf Me.CollateralCode = "58" Then
Me.Rate = "0.1000"
ElseIf Me.CollateralCode = "59" Then
Me.Rate = "0.1000"
Else
EH:
If Err.Number = 2501 Then
MsgBox "Incorrect Property Code"
End If
End If
End Sub
Any help would be most appreciated.
Thanks!!!