[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 604
  • Last Modified:

Hiding and activating a home-made ribbon in Access 2007 VBA

I have been struggling for some time with this. I have a ribbon defined for my app and it appears and works ok.

However, I want to show it when certain fields are entered and hide it when those field is exited.

In my investigations, I have found two ways to do this sort of thing:

DoCmd.ShowToolbar "ribbon", acToolbarYes  ' or acToolbarNo

This appears to grey out the ribbon but does not hide it altogether.

Also:

SendKeys "^{F1}", True      ' yes, I know it is naughty...

This does show the ribbon entirely but does not hide it but greys it out on alternate calls. Or something.

SO, can someone explain to me in words even I can understand what those two pieces of code do,
how I can achieve reliable show/hide of my ribbon
or perhaps suggest alternative ways of doing this with yet another piece of code.

Eternal gratitude.
0
Peborgh
Asked:
Peborgh
  • 7
  • 4
1 Solution
 
JezWaltersCommented:
0
 
JezWaltersCommented:
... yeah that does the trick for me - see the attached sample database!  :-)
Q26990828.mdb
0
 
JezWaltersCommented:
In case you're still wondering, sending the key strokes "Ctrl-F1" repeatedly in Access just minimises and then unminimises the ribbon.

Hope that helps!  :-)
0
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
JezWaltersCommented:
Bear in mind that the sample database I posted above still leaves you with the Office Button and the Quick Access Toolbar - is this what you want?
0
 
JezWaltersCommented:
If you don't want the Office Button/Quick Access Toolbar, your original idea of using the DoCmd.ShowToolbar method will achieve this:
Q26990828.mdb
0
 
PeborghAuthor Commented:
Thanx all, I won't be able to try all this out until Friday. I'll let you know what transpires soon after that...

peter
0
 
PeborghAuthor Commented:
Sorry to waste time. Somehow and suddenly (!) it all works using the "showtoolbars".

"No country for old men".

peter
0
 
JezWaltersCommented:
Hi Peter,

That's the same conclusion I came to in ID 35511937 above ... sometImes it really is worth just turning it off and on again!  ;-)

Please do bear in mind my comments regarding showing the Office Button/Quick Access Toolbar though!

Jez
0
 
PeborghAuthor Commented:
Jez. I intend to look into that on Wednesday.

Can you tell me what those two items look like on the screen. Just to be sure I don't want them...

Many thanks,

peter
0
 
JezWaltersCommented:
You should be able to see exactly how each case looks by trying out the two sample databases I posted ...

If you set an empty ribbon you get "EmptyRibbonWithOfficeButton.jpg" below.
If you disable the ribbon you get "DisabledRibbonWithoutOfficeButto.jpg".
EmptyRibbonWithOfficeButton.jpg
DisabledRibbonWithoutOfficeButto.jpg
0
 
PeborghAuthor Commented:
Jez, as a result of our eperimenting a couple of weeks' ago, It is all working now, with just one glitch that can be addresed later. many thanks. I will mark one of your contributions as solution because I can't use a face-to-face meeting for that!

Thanks,

peter
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

  • 7
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now