Hello need help to find the righjt instructions for this
From my TABLEA i have all users, birth, sex, study, job sex ecc and date of treatmntes
Need to select all record that under a range of date i supply supply me the number of all the user according to a filter, that can be kind of job, age range,studies carriers
And i need to have them separate, Female count and Male count
I have developed several queries, 2 for each filter, because one is fot the F and another is for M
Then from a table wher ei have all the queires name i read the queries name and count th number of record
this
Code:
Dim DBCorrente As DAO.Database
Dim rsRiepilogo As DAO.Recordset
Set DBCorrente = CurrentDb
Set rsRiepilogo = DBCorrente.OpenRecordset("Riepilogo", dbOpenDynaset)
rsRiepilogo.MoveFirst
Do Until rsRiepilogo.EOF
rsRiepilogo.Edit
rsRiepilogo!CountQuery = DCount("*", rsRiepilogo!NameQuery)
rsRiepilogo.Update
rsRiepilogo.MoveNext
Loop
rsRiepilogo.Close
DBCorrente.Close
i would like to have less queries, not to have 2 for each filter for m and f
and i think i could add an IIF inside the loop to check the Sex fields and according adding to the proper field of the RIEPILOGO table
SOmething like
IIf ((Riepilogo.Namequery.SEX) = "m"), TotM = TotM+1, TotF=TotF+1
instead of the DCOUNT line
but don t work
any help?
thans a lot