Hi all,
I'm new to the site and fairly new to Access.
I'm sure this is easy but I'm struggling and have searched a lot and can't seem to get this to work.
I have a form that a worker uses to record details of runaways (children). Each time this happens they input into a new record with dates and details etc.
I have a query:
SELECT DISTINCT RHI.[Name of YP], Count(RHI.[Name of YP]) AS [CountOfName of YP]
FROM RHI
GROUP BY RHI.[Name of YP];
Which gives me the number of times that person has gone missing.
What I want to do is display on a form (my form is called RHI) in an unbound txtbox the number of times the person on that form record has gone missing, the txtbox on the form that their name is in is called "Name of YP".
So for example, if a worker is looking at a record for Ben, and Ben has 3 records (and my Query - TimesMissing - returns 3) I want 3 to be showing in the box "txtMissingTimes".
ANY help is greatly appreciated, I think I need to use a Dlookup but can't get it to work - I am trying this:
=DLookUp([TimesMissing]![CountOfName of YP],[TimesMissing],[Name of YP])
and variations but no luck, only a #name error.
TIA
I'm new to the site and fairly new to Access.
I'm sure this is easy but I'm struggling and have searched a lot and can't seem to get this to work.
I have a form that a worker uses to record details of runaways (children). Each time this happens they input into a new record with dates and details etc.
I have a query:
SELECT DISTINCT RHI.[Name of YP], Count(RHI.[Name of YP]) AS [CountOfName of YP]
FROM RHI
GROUP BY RHI.[Name of YP];
Which gives me the number of times that person has gone missing.
What I want to do is display on a form (my form is called RHI) in an unbound txtbox the number of times the person on that form record has gone missing, the txtbox on the form that their name is in is called "Name of YP".
So for example, if a worker is looking at a record for Ben, and Ben has 3 records (and my Query - TimesMissing - returns 3) I want 3 to be showing in the box "txtMissingTimes".
ANY help is greatly appreciated, I think I need to use a Dlookup but can't get it to work - I am trying this:
=DLookUp([TimesMissing]![CountOfName of YP],[TimesMissing],[Name of YP])
and variations but no luck, only a #name error.
TIA