Report load event - A2003

S

swas

Hello,

I have several reports where I need to use both the onopen and onload event.

In A2007 this is no worries. In A2003 I have no load event. I initially
thought this may have been a corrupt mdb, confirmed not. Then I thought
possibly my A2003 installation may be corrupted in some way, so I
re-installed.

Still to no avail. Searching msdn etc... form and report events get very
mixed up, though definitely no report load event listed for A2003.

OK, so I have to come to terms with no report_load event in A2003. What are
the alternatives? Is onactivate ok to do filtering tasks, setting some header
textboxes, pass some filter criterea via openargs (Instead of the
docmd.openreport filter) etc...?


Thanks in advance.


swas
 
F

fredg

Hello,

I have several reports where I need to use both the onopen and onload event.

In A2007 this is no worries. In A2003 I have no load event. I initially
thought this may have been a corrupt mdb, confirmed not. Then I thought
possibly my A2003 installation may be corrupted in some way, so I
re-installed.

Still to no avail. Searching msdn etc... form and report events get very
mixed up, though definitely no report load event listed for A2003.

OK, so I have to come to terms with no report_load event in A2003. What are
the alternatives? Is onactivate ok to do filtering tasks, setting some header
textboxes, pass some filter criterea via openargs (Instead of the
docmd.openreport filter) etc...?

And what is wrong with using
DoCmd.OpenReport acPreview, , "[ID] = " & Me.[ID]
to filter the report?

You've asked a very generic question with no specifics mentioned.
All I can do is give you a very generic answer.

The report's Activate event only fires when a report is previewed, so
it's not a good idea to place code there that may not run when the
report is actually printed.

Anyway, if you must, you can use the Report's Open Event to filter the
data in the report.
Me.Recordsource = "Select TableName.* From TableName Where
TableName.ID = " & SomeNumberValue

Use the report's ReportHeader Format event to set the value of unbound
controls in the report if needed.
Me.ControlName = "SomeValue"
 
M

Marshall Barton

swas said:
I have several reports where I need to use both the onopen and onload event.

In A2007 this is no worries. In A2003 I have no load event. I initially
thought this may have been a corrupt mdb, confirmed not. Then I thought
possibly my A2003 installation may be corrupted in some way, so I
re-installed.

Still to no avail. Searching msdn etc... form and report events get very
mixed up, though definitely no report load event listed for A2003.

OK, so I have to come to terms with no report_load event in A2003. What are
the alternatives? Is onactivate ok to do filtering tasks, setting some header
textboxes, pass some filter criterea via openargs (Instead of the
docmd.openreport filter) etc...?


I think the report Load event is only used in Report view
and I don't understand what that is used for (maybe
something to do with sharepoint??) so you can not use the
Load event for ordinary reports. You should be able to get
by with just the Open event, or for some things other than
what you said, put the code in the report header's Format
event.
 
S

swas

Thanks for the quick responses.

To answer all comments in one response:

I am using a generic form to select multiple reports. When a report is
selected from a listbox, the form looks up what controls need displaying for
this report (Dates, customers, products, description etc...).

Because of a varying range of needs, I then pass this info via openargs to
the report. The report processes, validates, prepares and displays.

Hence my question was somewhat generic, and I apologise for that. I just
assumed I had a load event. With A2007 working on an A2003 file, the load
event is there. With an A2003 installation, it's not.

Supplying filter ctiterea, editing the recordsource, and the reportheader
event can all be used to solve my problem of no load event - I just need to
change a few things around.

Thanks for the comments.


swas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top