By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,495 Members | 1,231 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,495 IT Pros & Developers. It's quick & easy.

How can I make a report open in Report view?

P: 91
My reports always open in Print Preview, even though the DefaultView property is set to Report view.
I don't think this was always the case. When I was developing them they opened in Report view. Then I moved on to other parts of the development and now I find the reports always open in print preview, and I don't know how or when they changed.

I can't find anything in Access Options which might control this. I tried setting DefaultView=1 in an Open Event Procedure, but it just gave me a run-time message telling me to set the default view in Design view - which I had already done.

For at least one report it is important that it be opened in Report View because I have an OnPage procedure which should only be run when the final report is printed, not when it is merely viewed. (OnPage fires when Print Preview is opened. I can't find an event which only fires when the page is actually printed.)
Jan 7 '17 #1
Share this Question
Share on Google+
3 Replies


PhilOfWalton
Expert 100+
P: 1,430
Very odd. I assume you are opening the report by double clicking the report in the NavPane (bad practice - you should have a proper menu / switchboard).

Anyway Setting the Default View with the form in Design View works for me.

So maybe we should suspect corruption.
1) Does this happen with all reports?
2) Does the report open correctly by right clicking and choosing the appropriate option?
3) Have you tried compacting & repairing?
4) Have you tried creating a new report?
5) Have you tried creating a new database & importing everything into it (other than the suspect report)? But see question 1 first.

Phil
Jan 7 '17 #2

P: 91
Ah, Phil to the rescue once again! Happy New Year, Phil.

No, I'm opening the report from a switchboard. (In fact, I now suspect that's the problem - see below).

1) Yes, all reports
2) Yes, it opens in report view from the Nav pane default "Open" option
3) Yes, many times
4) Yes, same thing happens. It can be opened correctly from Nav pane in any of the 3 views, but only in Print Preview from the switchboard.
5) No, I haven't tried creating a new database and importing everything else into it. (There are well over 100 objects in the DB!)

I suspect that the problem lies in the way Switchboard opens the report. For Forms, in Switchboard Manager you have the option to open them in Add mode or Edit mode, but for Reports you don't get an option. It's just "Open Report".

Switchboard seems to be a rather curious beast, with convoluted recursive macro calls, but when I look into it in design mode (OptionLabel1 OnClick Embedded macro), "If [Command]=4" calls the OpenReport macro allegedly with view "Report". When I hover over the macro, however, a comment window pops up saying "Opens a report in Design View or Print Preview or prints a report immediately". I don't know how they do this, because as I said the macro appears to try to open the report in Report view. But the main issue is, I wonder if there's anything I can do about it (short of telling my users to forget the switchboard and open from the Nav pane :( !)
Jan 7 '17 #3

PhilOfWalton
Expert 100+
P: 1,430
Happy New year Peter.

AFIK that is a limitation of the built in Switchboard. It could be modified, but I think that would be quite a job.

I use a rather complex tree type menu for nearly all my programs



But if you google there appear to be other switchboards out there.

Phil
Jan 7 '17 #4

Post your reply

Sign in to post your reply or Sign up for a free account.