After i copy and pasted the code, it shown same as below
Private Sub Salary_BeforeUpdate(Cancel As Integer)
Dim blnError As Boolean
Dim strJob As String
Select Case Me.Job
Case "Engineer"
If Me.Salary Not Between 30000 And 40000 Then
blnError = True
strJob = "Engineer"
End If
Case "Trainee"
If Me.Salary Not Between 20000 And 30000 Then
blnError = True
strJob = "Trainee"
End If
Case "Clerk"
If Me.Salary Not Between 0 And 20000 Then
blnError = True
strJob = "Clerk"
End If
End Select
If blnError Then
Cancel = True
MsgBox "You have entered a salary for the " & strJob & vbCrLf & _
"which is out of the appropriate range. Please try again!, vbExclamation, "Salary Entry Error"
Exit Sub
End If
End Sub
That means the coding got problem . May you correct it?
Private Sub Salary_BeforeUpdate(Cancel As Integer)
Dim blnError As Boolean
Dim strJob As String
Select Case Me.Job
Case "Engineer"
If Me.Salary Not Between 30000 And 40000 Then
blnError = True
strJob = "Engineer"
End If
Case "Trainee"
If Me.Salary Not Between 20000 And 30000 Then
blnError = True
strJob = "Trainee"
End If
Case "Clerk"
If Me.Salary Not Between 0 And 20000 Then
blnError = True
strJob = "Clerk"
End If
End Select
If blnError Then
Cancel = True
MsgBox "You have entered a salary for the " & strJob & vbCrLf & _
"which is out of the appropriate range. Please try again!, vbExclamation, "Salary Entry Error"
Exit Sub
End If
End Sub
That means the coding got problem . May you correct it?