[AccessD] New engagement; trying to avoid the "tip of the iceberg" consulting trap

Mark Simms marksimms at verizon.net
Tue Nov 9 16:21:27 CST 2010


Thanks much. Below is the cross-version solution to be executed in the
start-up form.

#If VERSION = 2007 then
   DoCmd.ShowToolbar "Ribbon", acToolbarNo
#End If

On second thoughts, this doesn't have to be a compiler directive, does it ?
IOW: that statement will parse fine in the 2003 VBA interpreter, correct ?

> -----Original Message-----
> From: accessd-bounces at databaseadvisors.com
> [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
> Stuart McLachlan
> Sent: Tuesday, November 09, 2010 4:42 PM
> To: Access Developers discussion and problem solving
> Subject: Re: [AccessD] New engagement; trying to avoid the
> "tip of the iceberg" consulting trap
>
> It's gets a  bit kludgy, but you can control the ribbon in VBA.
>
> >From a post by me to the  the list on 4 Dec 2008:
>
> My Height was slightly different to those in the link,
> probably because of different screen resolutions, fonts etc
> but it looks like it will always be  above/below 100 so this
> should work anywhere. It certainly works for
> me:
>
> Function RibbonMinimized() As Boolean
> RibbonMinimized = Application.CommandBars("Ribbon").Height <
> 100 End Function
>
> The following four functions give you full control over the Ribbon :-)
>
> Function HideRibbon()
>        DoCmd.ShowToolbar "Ribbon", acToolbarNo End Function
>
> Function ShowRibbon()
>        DoCmd.ShowToolbar "Ribbon", acToolbarYes End Function
>
> Function MinimizeRibbon()
>     If Not RibbonMinimized Then SendKeys "^{F1}"
>     End If
> End Function
>
> Function MaximizeRibbon()
>     If RibbonMinimized Then SendKeys "^{F1}"
>     End If
> End Function
>
>
>
>
> On 9 Nov 2010 at 16:00, Mark Simms wrote:
>
> > Yes Susan, it worked fine saved as an MDB from AC2007. They
> utilized
> > zero 2007 features as far as I can see.
> >
> > Interestingly, in this project, there is a good reason to
> use compiler
> > directives to handle things like turning off the ribbon which only
> > works in 2007. In that regard, I change one line of code,
> and the code
> > will be interpreted under 2007. ' place this at the top of a module
> > #Const VERSION = 2003
> >
> > #If VERSION = 2007 Then
> >   ' add code to remove ribbon here
> > #End If
> >
> > Problem is: I don't think there's a way in VBA to remove
> the ribbon,
> > is there ? I saw the manual method...ughh...it's a
> cludge...creating a
> > blank ribbon.
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>





More information about the AccessD mailing list