VBA manipulation of a report (1 Viewer)

accessuser1023

Registered User.
Local time
Today, 06:59
Joined
Nov 12, 2012
Messages
71
Hello all,

This is an expansion of my other thread: http://www.access-programmers.co.uk/forums/showthread.php?t=253820

My database is not designed very well at all. It's fairly small, but what I need to do is ... after you search for records, on the next form there is a button for printing the search results. I am looking for a workaround to this.

Right now what I'm doing is throwing the search result's data to a table "tblSearchOutput" and running the report off of that. However, the issue I'm having is that the field "abstract" and the rest of the fields will never fit on one page so what I did in the temp table was create alternating records (one for the summary data, and then the next record after that as the abstract field only). Then I'm trying to conditionally make visible all the report fields in the detail section. That will give me two report pages per record.

However, in report view apparently I can't make the Format() event work properly? In print preview mode, I can't dynamically change control sources in the report header, which I need to in order to show the filter results.

Does anyone have a solution or suggestion for me on this?

Thanks!
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 04:59
Joined
Aug 30, 2003
Messages
36,125
Not sure I follow the whole setup, but while it's true that the Format events don't fire in Report view, you can certainly change control sources in Preview mode. I do it in the Open event.
 

accessuser1023

Registered User.
Local time
Today, 06:59
Joined
Nov 12, 2012
Messages
71
Not sure I follow the whole setup, but while it's true that the Format events don't fire in Report view, you can certainly change control sources in Preview mode. I do it in the Open event.

Paul,

I will try the preview mode this weekend as see if that is true. I thought I tried that earlier, but I will check again. Thanks. I will get back to you if I find it doesn't work.
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 04:59
Joined
Aug 30, 2003
Messages
36,125
It should definitely work in the open event, but certainly post back if you have trouble. I've done it many times with dynamic crosstab reports, since the fields change every time they're run.
 

Users who are viewing this thread

Top Bottom