Records Count

  • Thread starter Thread starter Guest
  • Start date Start date
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Records Count 3
Records Count 2
Show all records event 1
checking subform for records 9
Dynamic Class Instantiate 0
domain count or sum 1
No Records for Form 7
Move a subform to the last record 1

Back
Top