View Full Version : passing variables back from VBA to a report


geoffl
10-18-2004, 03:22 AM
I am running a report which returns several records via a query

For each record, one of the required fields contains multiple lines of text

I want each line of text to appear in its own box on the report

I have written a VBA report module subroutine which splits the text into an array of string variables strPart(1 to 10)

The module is called from the report's Detail - On Format event

1) How can I return the variables to the report?
2) Do I need a subroutine or a function
3) Am I trying to do this in completely the wrong way?

Any help would be appreciated

KenHigg
10-18-2004, 04:02 AM
Just curious, why do you want the text in seperate boxes?

kh

geoffl
10-18-2004, 07:32 AM
The text is a series of bullet points and each one needs to be in its own space on the report with certain standard text appended to each point. It's the way we want to see it and we don't want to create multiple database fields, ie one for each point.

gl

KenHigg
10-18-2004, 07:52 AM
Hum... Interesting concept.

I think I would create a temp table that gets populated at run time. Each record would have a master record number and a pont text fld. Then use this in a sub report. That way you don't have to commit to 10 text points for each record on the report.

Make sense?
(just an idea)
kh

geoffl
10-21-2004, 04:07 AM
Thanks Ken, you got my head thinking straight

I've put my splitting code in Report_Open and populated a temporary table

Report-Detail then simply uses the temp table as its source

Rgs GL