Simpler Method?

L

LongWayFromHome

I need to know whether the items -- identified by [EnFNo] -- to be listed in
my subreport all have the same text in [StudentCampus] or differ from each
other. In my subreport header, I have this code:

strEndNum = Me.EnFNo
strCampus1st = Me.StudentCampus
intEndwCnt = DCount("[EnFNo]", "Rpt2Qry", "[EnFNo]= '" & strEndNum & "'")
intCampus1stCnt = DCount("[StudentCampus]", "RptEndwmtSubRpt2Qry",
"[StudentCampus]= '" & strCampus1st & "' AND [EnFNo]= '" & strEndwFNum & "'")

If intEndwCnt <> intCampus1stCnt, then I know they are not all the same.

Since the queries are complex and the list of students can be long, these
DCounts are very slow. Is there a quicker way? I need to know the answer
before the detail section formats.

Bonus question: why might the report header on my subreport run more than
once? It seems to run twice -- which doubles the drag imposed by the DCounts!

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top