Write text programatically

I

Isaack Rasmussen

Hello,

I'm trying to make a report that will output data from Database
tables. Doing it linearly is easy enough.
But I want more control over the grouping and use conditional
statements in the loop.
I have not been able to figure out how to do this in the Detail
segment of a Report. So I then tried to use VBScript, but using the
function "print" doesn't work as specified in the help files.

I'm running on Access 97 and the error I actually get is,
Runtime error: 2158
Application-defined or Object-defined Error

And the line is my,
Me.Print ("Testing myself")

Me seems to work fine, but not in combination with Print.

I'm sure this has been asked before, but I have not been able to find
anything as my keywords appears to be too generic.

Thanks in advance,
 
D

Douglas J. Steele

Unless it's changed recently, forms and reports don't have a Print method:
only the Debug object does (Debug.Print writes to the debug window)
 
I

Isaack Rasmussen

Hello Douglas,

Thanks for the reply. So does it mean that there's no way to
programatically write text on the report?

Isaack
 
D

Douglas J. Steele

No, that's not the case. You can, for example, put a text box on your report
and use VBA to write to the text box. Let's say you've added a textbox
txtScratchpad to your report. You'd then use:

Me!txtScratchpad = "Testing myself"
 
M

Mike Painter

Douglas J. Steele said:
No, that's not the case. You can, for example, put a text box on your report
and use VBA to write to the text box. Let's say you've added a textbox
txtScratchpad to your report. You'd then use:

Me!txtScratchpad = "Testing myself"

I'd suggest a copy of Access Developers Handbook. It has a lot of
information about reports that includes most if not all of what has been
requested.
www.bookpool.com has always had the best price.
 
Top