dpokerbear
asked on
Using Reports Recordset in a DCount Function
I am using this code in a ControlSource of a text box on a Report. It doesn't work as it doesn't like the syntax which states Me.Recordset.
=DCount("SatisfactionRatin g", Me.Recordset,"Satisfaction Rating = 1")
Please advise if you know what would be correct syntax for the above function. Thanks.
=DCount("SatisfactionRatin
Please advise if you know what would be correct syntax for the above function. Thanks.
ASKER
Hi JDettman,
I know that [RecordSource] can be used and that just gets whatever table or query is listed under that property.
However, when I am opening the report using docmd.openreport, i specify a WHERE clause. So i actually need to work with the recordset you see, otherwise it will display all records for that table or query and I don't want that...
I know that [RecordSource] can be used and that just gets whatever table or query is listed under that property.
However, when I am opening the report using docmd.openreport, i specify a WHERE clause. So i actually need to work with the recordset you see, otherwise it will display all records for that table or query and I don't want that...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Jim,
I made a query to work around the problem.
Thanks for the effort in assisting me with this problem.
I made a query to work around the problem.
Thanks for the effort in assisting me with this problem.
Instead of Me.Recordset, you need to use whatever the report is using. If it's a table, name the table. If it's a query, name the query.
You also could get the Dcount in code.
JimD.