Re: message: Zoom not available now.



As Rick Brandt wrote...
For some reason commands that change the report's window size and/or the
zoom level cannot be called in the Open event of the report itself.
***You have to add them to the code that opens the report...***

That code must be in the form/button code that "calls" the report... not in the Report
itself.

Private Sub cmdOpenMyReport_Click()
DoCmd.OpenReport "Chart - Administration", acViewPreview
DoCmd.RunCommand acCmdZoom75
End Sub

--
hth
Al Campagna
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions


"scubadiver" <scubadiver@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:FACFB98B-AE00-4532-A7DA-A2CB98266864@xxxxxxxxxxxxxxxx

I have the following code in the report I want to open.

Private Sub Report_Open(Cancel As Integer)

DoCmd.OpenReport "Chart - Administration", acViewPreview
DoCmd.RunCommand acCmdZoom75

End Sub

It gives a run time error "2046" and says "the command or action 'zoom75%'
isn't available now".

What does SOL mean?

cheers.



"Rick Brandt" wrote:

scubadiver wrote:
On the "on open" event for a report I have tried a macro using "run
command" with the "zoom75%" option but I still get the message "the
command or action 'zoom75%' isn't available now".

It then says "Use only those commands and macro actions that are
currently available for this database".

For some reason commands that change the report's window size and/or the
zoom level cannot be called in the Open event of the report itself. You
have to add them to the code that opens the report...

DoCmd.OpenReport "ReportName", acViewPreview
DoCmd.RunCommand acCmdZoom75

If you are not opening the report from code then you might be SOL.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com





.