View Single Post
Old 04-27-2018, 06:33 AM   #2
MarkK
Super Moderator
 
MarkK's Avatar
 
Join Date: Mar 2004
Location: Vancouver BC
Posts: 7,761
Thanks: 10
Thanked 1,289 Times in 1,227 Posts
MarkK is a name known to all MarkK is a name known to all MarkK is a name known to all MarkK is a name known to all MarkK is a name known to all MarkK is a name known to all
You are filtering the report when you open it...
Code:
DoCmd.OpenReport sReportName, acViewReport, , "[COST_CENTER] = " & iDepartment
...so you need to filter the DCount() too...
Code:
If DCount("*", sRecordSource, "[COST_CENTER] = " & iDepartment) > 0 Then
hth
Mark
__________________
formerly known as lagbolt | Windows 10 | Access 2010 | Visual Studio 2013 | "Institutions have a vested interest in perpetuating the problems to which they are the solution." - Clay Shirky
MarkK is offline   Reply With Quote
The Following User Says Thank You to MarkK For This Useful Post:
jeran042 (04-27-2018)