Dan Waters
df.waters at comcast.net
Mon Jun 6 15:43:19 CDT 2011
Hi Tony, In my system (developed in Access 2003), I turn off ALL the built-in toolbars when users are logged on. But I made a custom toolbar for reports so they can be closed, emailed, printed, etc. But if I don't allow the ribbon for reports when using Access 2007+, the users could open a report, and then they'd be stuck. So I allow the Access 2007 ribbon to open when a report opens, and then they've got the control they need, but they can't make any database changes. Also, when a report opens, I use DoCmd.Maximize to be sure that the report screen covers everything else. When the report closes, I use DoCmd.Restore to get everything back to its previous condition. Here's something I learned by trial and error: Don't place DoCmd.Maximize in the Open event for the report. Instead, place it immediately after the code which opens the report like this: DoCmd.OpenReport "rptXXX", acViewPreview DoCmd.Maximize HTH! Dan -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Tony Septav Sent: Monday, June 06, 2011 2:45 PM To: Access Developers discussion and problem solving Subject: Re: [AccessD] Ribbons Hey Dan Thank you Just wondering why I would turn on the ribbon for reports, I control what user can access when doing reports? Dan Waters wrote: >Hi Tony, > >DoCmd.ShowToolbar is the correct command. However, you may need to >have the toolbar displayed for reports. If so, this is what I do: > >'-- Turn ribbon on/off as needed >Public Sub DisplayRibbon(blnDisplayRibbon As Boolean) > > '-- Purpose: The ribbon is only displayed in Access 2007 reports >and up. > > If SysCmd(acSysCmdAccessVer) >= 12 Then > If blnDisplayRibbon = True Or >DBEngine(0)(0).Properties("AllowSpecialKeys") = True Then > DoCmd.ShowToolbar "Ribbon", acToolbarYes > Else > DoCmd.ShowToolbar "Ribbon", acToolbarNo > End If > End If > >End Sub > >'-- Turn ribbons off when the app opens Private Sub MainForm_Open() > > Call DisplayRibbon(True) > >End Sub > >'-- Turn the ribbons on when opening a report Private Sub >Report_Open(Cancel As Integer) > > Call DisplayRibbon(True) > >End Sub > >'-- Turn the ribbons off when closing a report Private Sub >Report_Close() > > Call DisplayRibbon(False) > >End Sub > >HTH! >Dan >-----Original Message----- >From: accessd-bounces at databaseadvisors.com >[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Tony Septav >Sent: Monday, June 06, 2011 2:11 PM >To: Access Developers discussion and problem solving >Subject: [AccessD] Ribbons > >Hey All >Well I just ran into the 12th hour syndrome. Did my installation >package for an Access2003 application and found out the client users >are not allowed to access their C: drive. They have Access2007 on their server. >I have tried to search the database advisors archives (some days I can >some days I can't) today I can't. I would like to turn off the >Access2007 ribbon. My question is would this work on opening the MDE?? >DoCmd.ShowToolBars "Ribbon",acToolBarNo > >Thanks Kindly >-- >AccessD mailing list >AccessD at databaseadvisors.com >http://databaseadvisors.com/mailman/listinfo/accessd >Website: http://www.databaseadvisors.com > > > > -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com