Records Count

  • Thread starter Thread starter Jon-e-walker
  • Start date Start date
J

Jon-e-walker

Can somebody Help Me how can I automate Access to Produce an ID
depending on the amount of People on a Personel Data Table that have a
Particular Personnel Title Assigned (Personnel_Type)

I want my Loan Officers with to have ID's arround the 100's
I want my Mortgage Brokers to have ID'd arround the 200's
and so on...
without reusing an ID that alredy Exists.... so I though... If I
want to add a Loan officer... I first count the number of Loan
Officers already on the DateBase... then add 101... and If you may...
how can I add the letters "LO" infront of the number that is to be
created... Thanks

Here is the Code I tried


Private Sub Personnel_Type_AfterUpdate()
Dim intLO As Interger
Dim intMB As Interger
Dim intLP As Interger
Dim intAS As Interger

If Personnel_Type = "Loan Officer" Then
intLO = DCount("[Personnel_Type]", "Personel Data Table",
"[Personnel_Type]='Loan Officer'")
ID = intLO + 101
End If
If Personnel_Type = "Mortgage Broker" Then
intMB = DCount("[Personnel_Type]", "Personel Data Table",
"[Personnel_Type]='Mortgage Broker'")
ID = intMB + 201
End If
If Personnel_Type = "Loan Processor" Then
intLP = DCount("[Personnel_Type]", "Personel Data Table",
"[Personnel_Type]='Loan Processor'")
ID = intLP + 301
End If
If Personnel_Type = "Admin Staff" Then
intAS = DCount("[Personnel_Type]", "Personel Data Table",
"[Personnel_Type]='Admin Staff'")
ID = intAS + 401
End If
 
To be honest, I'm not sure about the rest of the code- but have you double-
checked your spelling of the word "Integer"? Looks like you have down
"Interger," which may throw a wrench in the works, unless it's a regional
variation I'm unaware of.

Jon-e-walker said:
Can somebody Help Me how can I automate Access to Produce an ID
depending on the amount of People on a Personel Data Table that have a
Particular Personnel Title Assigned (Personnel_Type)

I want my Loan Officers with to have ID's arround the 100's
I want my Mortgage Brokers to have ID'd arround the 200's
and so on...
without reusing an ID that alredy Exists.... so I though... If I
want to add a Loan officer... I first count the number of Loan
Officers already on the DateBase... then add 101... and If you may...
how can I add the letters "LO" infront of the number that is to be
created... Thanks

Here is the Code I tried

Private Sub Personnel_Type_AfterUpdate()
Dim intLO As Interger
Dim intMB As Interger
Dim intLP As Interger
Dim intAS As Interger

If Personnel_Type = "Loan Officer" Then
intLO = DCount("[Personnel_Type]", "Personel Data Table",
"[Personnel_Type]='Loan Officer'")
ID = intLO + 101
End If
If Personnel_Type = "Mortgage Broker" Then
intMB = DCount("[Personnel_Type]", "Personel Data Table",
"[Personnel_Type]='Mortgage Broker'")
ID = intMB + 201
End If
If Personnel_Type = "Loan Processor" Then
intLP = DCount("[Personnel_Type]", "Personel Data Table",
"[Personnel_Type]='Loan Processor'")
ID = intLP + 301
End If
If Personnel_Type = "Admin Staff" Then
intAS = DCount("[Personnel_Type]", "Personel Data Table",
"[Personnel_Type]='Admin Staff'")
ID = intAS + 401
End If
 
I thought I had answered this question some time back.
Is it still not working? What problems are you having?
 
Back
Top