Turn Ribbon back on when opening report. (1 Viewer)

Dairy Farmer

Registered User.
Local time
Tomorrow, 00:37
Joined
Sep 23, 2010
Messages
244
I have the following code in my "switchboard" On Open procedure. For reports I have a custom ribbon (via USysRibbons). It is the standard print ribbon. Reports open in print preview.

Code:
DoCmd.ShowToolbar "Ribbon", acToolbarNo

I need to turn this ribbon on when the report is open. The following code doesn't work.
Code:
DoCmd.ShowToolbar "Ribbon", acToolbarYes

Any ideas? I don't want to assume that users know they can use Ctrl-P.
 

vbaInet

AWF VIP
Local time
Today, 22:37
Joined
Jan 22, 2010
Messages
26,374
Leave the toolbar on always.

Simply set each report's Ribbon property to the name of your ribbon saved in the USys table.
 

Avelino

Registered User.
Local time
Today, 18:37
Joined
Dec 10, 2009
Messages
56
Hi Dairy

See the example will serve.
 

Attachments

  • testRibbon.accdb
    456 KB · Views: 366

Dairy Farmer

Registered User.
Local time
Tomorrow, 00:37
Joined
Sep 23, 2010
Messages
244
Leave the toolbar on always.
Simply set each report's Ribbon property to the name of your ribbon saved in the USys table.

Was looking for no ribbon/toolbar except for reports. Looking for this look for the app and just a print ribbon when previewing a report.



Hi Dairy
See the example will serve.

Looks great. Thanks. I see what you did with the Got Focus on the main form and the USysRibbons.
 

Attachments

  • Untitled.png
    Untitled.png
    15.1 KB · Views: 1,481

Dairy Farmer

Registered User.
Local time
Tomorrow, 00:37
Joined
Sep 23, 2010
Messages
244
See the example will serve.

Oh, no. I have a problem.

Refere to the screenie I posted.
The main form is always in the background. If I click on the "Enter Data" button I will get a popup form (popup + modal =yes). On that form I have a button that opens the report in preview mode.

The code does not work in this situation.
 

Avelino

Registered User.
Local time
Today, 18:37
Joined
Dec 10, 2009
Messages
56
Hi,

download the example and see if it serves.
 

Attachments

  • testRibbon_r1.accdb
    368 KB · Views: 308

vbaInet

AWF VIP
Local time
Today, 22:37
Joined
Jan 22, 2010
Messages
26,374
Was looking for no ribbon/toolbar except for reports. Looking for this look for the app and just a print ribbon when previewing a report.
Ok you will need to create a blank ribbon and assign that as your default ribbon under Access Options > Current Database.

When you open your reports, set the Ribbon property to the report ribbon you created.
 

Dairy Farmer

Registered User.
Local time
Tomorrow, 00:37
Joined
Sep 23, 2010
Messages
244
Ok you will need to create a blank ribbon and assign that as your default ribbon under Access Options > Current Database.

Note the screen shot. I dont want a ribbon at all except when previewing a report. Avelino frist samle db worked when opening the report from the main window, but not for a report (popup/modal) opened from form (popup/modal) opened from the main form (not popup or modal) .

@ Avelino - sample R1 works fine. Thanks. I'll look at the code and see how you did it.
 
Last edited:

vbaInet

AWF VIP
Local time
Today, 22:37
Joined
Jan 22, 2010
Messages
26,374
Note the screen shot. I dont want a ribbon at all except when previewing a report. Avelino frist samle db worked when opening the report from the main window, but not for a report (popup/modal) opened from form (popup/modal) opened from the main form (not popup or modal).
Popup or forms don't have a ribbon attached to them. The ribbon you see belongs to the form that is behind the popup or modal form.

It seems Avelino has sorted you out.
 

Dairy Farmer

Registered User.
Local time
Tomorrow, 00:37
Joined
Sep 23, 2010
Messages
244
I've been off for a few days. I did get it to work.... But ... I see the code relies on closing the form that has the links to the reports. I may need to rethink this form as the user may want to preview another report after rinting and I don't want them to mave to go back via the main menu.

Main form
Always open
Button link to reports form

Reports form
Combo box to select month/year
Tab control with Current, Previous, Next and Custom tabs

Tab
Upto 8 buttons
Each button opens a report in preview
Click a button, report opens with ribbon, report form closes
Next to each button is a check box so that user can select multi reports
Also a button for preview all reports for a tab

Code works fine up to here.

Now if user selects Current, Report 1
Report opens fine in preview
User prints or closes report
Returns to Main form
User must now select reports form, then change combo month/year, then another report.

I don't know if I should rather have an on open/got focus procedure in the report that asks if the user want to print that report.
 

Users who are viewing this thread

Top Bottom