Design view in .MDE (Access97)

I

Ian Smith

I understood you could not open a report in design view in
a .MDE file, so I reluctantly have multiple copies of
virtually identical reports to attend to minor variations
in sorting, grouping, and records source.

But I recently read that VBA can open in design view for
just such tweaking. It this true, 'cause it isn't working
for me.

This code works in .MDB, but fails in .MDE, saying the
feature isn't available in a .MDE.

MsgBox ("About to open report in design view")
DoCmd.OpenReport "Report1", acViewDesign
MsgBox ("Sucessful open in design view")
Reports!Report1.RecordSource = "Select * from
Query2"
DoCmd.OpenReport "Report1", acViewNormal
DoCmd.Close acReport, "Report1", acSaveNo
 
R

Rick Brandt

Ian Smith said:
I understood you could not open a report in design view in
a .MDE file, so I reluctantly have multiple copies of
virtually identical reports to attend to minor variations
in sorting, grouping, and records source.

But I recently read that VBA can open in design view for
just such tweaking. It this true, 'cause it isn't working
for me.

You cannot make (permanent) design changes to a report in an MDE, but you can
(temporarily) change properties of the report during Runtime in an MDE. For
instance you could set a Global variable to the SQL you want to use as the
RecordSource and then in the Open Event of the Report do something like...

Me.RecordSource = GlobalVariableName

This is no different from changing properties of a form. It doesn't require a
"design change" to open a form and apply a different RecordSource or filter.
You just have to know that any property changes made are for that one instance
and not permanent. A report is just more restrictive about where you can make
such changes. The Open event allows you to do pretty much anything like this.
Once printing has begun, there are many report properties that are no longer
changeable in code.
 
S

SA

Ian:

To clarify what Rick is saying related to reports, is that you can address
various properties of a report in an MDE, but it has to be open to do so and
you can only open a report in preview mode; you can't open in design view
(aka your original post).
 

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