G
Guest
Why does this does not work.... When I run thios Code on a Form... it
automaticly changes the end of the Code from "End Sub" to "End Function"
Is there another alternative to extract the value of the Record Count
Function "DCount" to utilize it on a LostFocus 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
automaticly changes the end of the Code from "End Sub" to "End Function"
Is there another alternative to extract the value of the Record Count
Function "DCount" to utilize it on a LostFocus 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