Peter Peterson
Member
- Local time
- Tomorrow, 05:29
- Joined
- Sep 14, 2020
- Messages
- 38
Hi - I have read #post-1637811 a number of times and modified my code but still can't get the result I need/expect.
I have a client table "tblClients" and a table "tblStatus" to track the status my clients are through a process, e.g. field [Status] (Lead, Appointment Booked, Appointment Held, Closed).
I have a field in tblClients [ClientStatus_ID] linked to tblStatus [StatusID].
I want to display on a form the number of clients at each stage of the process, i.e. how many clients are at the Lead stage, the Appointment Booked state, etc.
I followed @arnelgp code but I must have some misunderstanding of what I'm doing
I end up an Run-time Error 2471 - The expression you entered as a query parameter produced this error: 'Lead'
Any help will be most welcome
Thanks Peter
I have a client table "tblClients" and a table "tblStatus" to track the status my clients are through a process, e.g. field [Status] (Lead, Appointment Booked, Appointment Held, Closed).
I have a field in tblClients [ClientStatus_ID] linked to tblStatus [StatusID].
I want to display on a form the number of clients at each stage of the process, i.e. how many clients are at the Lead stage, the Appointment Booked state, etc.
I followed @arnelgp code but I must have some misunderstanding of what I'm doing
Private Sub updateClientProcessNumbers()
Dim lngCount As Long
Dim varClientStatus As Variant
lngCount = DCount("*", "tblClients", "ClientStatus_ID=" & DLookup("Status", "tblStatus", "Status='Lead'"))
Me.cmdNumLead.Caption = CStr(lngCount)
End Sub
I end up an Run-time Error 2471 - The expression you entered as a query parameter produced this error: 'Lead'
Any help will be most welcome
Thanks Peter