using form to generate Report with input variable

  • Thread starter Thread starter Nancy
  • Start date Start date
N

Nancy

Hi,
I am using a form to run sql, create a query off of the
sql, then generate a report off of the query. The form
also has code to compare the number of records between 2
tables. The difference needs to be displayed on the
report. My question is how do I get the difference to
display on the report ?

The code to compare the 2 tables is:
cntPrev = (DCount("*", "Provider Additions - prev"))
cntCurr = (DCount("*", "Provider Additions - curr"))
cntDiff = cntCurr – cntPrev

I need to display the variable “cntDiff” in the report
heading.

Thanks in advance for any suggestions.
 
In you nice little prompt form, simply create a control that is un-bound.
Then, simply stuff the result of cntDiff into that control like:

me.txtDiffBox = cntDiff

Then, in the reports header, you can place a text box that refers to the
form, like:


=(forms!CuteLittleForm!txtDiffBox)

I always use nice little forms to launch reports. Here is some screen shots
to give you some ideas of what I mean:

http://www.attcanada.net/~kallal.msn/ridesrpt/ridesrpt.html
 
Back
Top