G
Guest
Why Does this Doesnt work?
When I run this code, It automaticly changes the end of the code from "End
Sub" to "End Function" and the error says "End Sub is Expected" can you
please help me.
Is it that you cant run a function inside an Event?
Private Sub Personel_Type_LostFocus()
Public Function IdCount(ByVal strPT As String) As Integer
IdCountLO = DCount("[Personnel Type]", "Personel Data Table", _
"[Personnel Type] = '" & strPT)
If Personnel_Type.Value = "Loan Officer" Then
: IdCount = "Loan Officer"
ID.Value = IdCount + 101
End If
If Personnel_Type.Value = "Mortgage Broker" Then
: IdCount = "Mortgage Broker"
ID.Value = IdCount + 201
End If
If Personnel_Type.Value = "Loan Processor" Then
: IdCount = "Loan Processor"
ID.Value = IdCount + 301
End If
If Personnel_Type.Value = "Admin Staff" Then
: IdCount = "Admin Staff"
ID.Value = IdCount + 401
End If
End Sub
When I run this code, It automaticly changes the end of the code from "End
Sub" to "End Function" and the error says "End Sub is Expected" can you
please help me.
Is it that you cant run a function inside an Event?
Private Sub Personel_Type_LostFocus()
Public Function IdCount(ByVal strPT As String) As Integer
IdCountLO = DCount("[Personnel Type]", "Personel Data Table", _
"[Personnel Type] = '" & strPT)
If Personnel_Type.Value = "Loan Officer" Then
: IdCount = "Loan Officer"
ID.Value = IdCount + 101
End If
If Personnel_Type.Value = "Mortgage Broker" Then
: IdCount = "Mortgage Broker"
ID.Value = IdCount + 201
End If
If Personnel_Type.Value = "Loan Processor" Then
: IdCount = "Loan Processor"
ID.Value = IdCount + 301
End If
If Personnel_Type.Value = "Admin Staff" Then
: IdCount = "Admin Staff"
ID.Value = IdCount + 401
End If
End Sub