about reports

  • Thread starter Thread starter bart van deun
  • Start date Start date
B

bart van deun

How can i print my report as many as times(a record individually in that
report) as a number in that query part of that record...

thank you,
Bart from Belgium
 
Basically, in the Format event of the detail section you would tell it to
not move to the next record. You would keep a counter running (Static
variable) to know how many times you've looped through. You would compare
this loop count to the value in the field of the record.

Here is a link to an example of doing this. It takes its value from a form's
textbox, but you could use the field in the report's recordset also.

http://support.microsoft.com/default.aspx?scid=kb;en-us;207664&Product=acc2000
 
Thank you Wayne, verry usefull...

Bart


Wayne Morgan said:
Basically, in the Format event of the detail section you would tell it to
not move to the next record. You would keep a counter running (Static
variable) to know how many times you've looped through. You would compare
this loop count to the value in the field of the record.

Here is a link to an example of doing this. It takes its value from a form's
textbox, but you could use the field in the report's recordset also.

http://support.microsoft.com/default.aspx?scid=kb;en-us;207664&Product=acc2000
 
little problem:
How can i refer to a value in a query instead off a form?

intNumberRepeats = Forms!PrintForm!TimesToRepeatRecord

Thank you, again, Wayne.

Bart
 
The easiest way I've found is to place a textbox on the report and bind it
to that field. Set the visible property of the textbox to No. You can now
refer to this textbox in the report's code. Of course, the field has to be
part of the recordset being used as the report's Control Source, if it
isn't, then use the DLookup function to get the value.
 
How do i refer to that box in my report?

intPrintCounter = 1
intNumberRepeats = 2 ' (what do i put here?)

thank you,
Bart
 
intPrintCounter = 1
intNumberRepeats = 2 ' (what do I put here?)

Change the second line to refer to the textbox on the report:

intNumberRepeats = Me.txtRepeatNumber
'change txtRepeatNumber to the actual name of your textbox.
 
When i do this i get this fault: fault 2427 (Expression without a value)

whilst there is a value in the txtbox...

Thank you,
Bart
 
You will have to step through the code and verify that a value is being
assigned to intNumberRepeats. If not, then you probably have a typo
somewhere. In the Declarations section of the report's code do you have
Option Explicit? It will probably be the next line immediately below Option
Compare Database. If it's not there, add it and try doing a compile by going
to Debug|Compile... Adding this option forces the compiler to check for
invalid names (controls that don't exist, variables that aren't Dimed, etc).
 
I found it!!!
intNumberRepeats = Me.txtRepeatNumber
has to be put in the detail section (Me.) to filter the records of course!

For me it is verry good for learning to better understand...

Thank you, Wayne, for the time and effort!!

Bart from Belgium
 
Back
Top