Ribbon on form (1 Viewer)

pjs

New member
Local time
Today, 14:13
Joined
Feb 4, 2010
Messages
6
Set-up as follows:
USysRibbon table with 2 custom ribbons
Autoexec macro runs LoadRibbons() (LoadCustomUI)
All ribbons listed in form properties
Button on form opens blank query for user reports. Want to attach a custom ribbon to the button.
Docmd.ShowToolbar "qryRibbon", acToolbarYes gives the error "Toolbar not found"
How do I get VB to see the ribbon and open it on the button click event?
Thanks in advance.
pjs
 

vbaInet

AWF VIP
Local time
Today, 12:13
Joined
Jan 22, 2010
Messages
26,374
Form's have a Ribbon property, so you do:

NameOfMyForm.RibbonName = "nameOfCustomRibbon"

You won't be able to set a ribbon for a query so you would have to use a form based on your query.
 

pjs

New member
Local time
Today, 14:13
Joined
Feb 4, 2010
Messages
6
Form's have a Ribbon property, so you do:

NameOfMyForm.RibbonName = "nameOfCustomRibbon"

You won't be able to set a ribbon for a query so you would have to use a form based on your query.

Your idea looked like a nice easy solution. I'd hoped that in opening a custom ribbon on a form to locate a query, the query design view could 'inherit' the ribbon from the form. no such luck.
I will now use the 2003 custom menu instead, seems the only choice.
Thanks
pjs
 

vbaInet

AWF VIP
Local time
Today, 12:13
Joined
Jan 22, 2010
Messages
26,374
As a workaround, use a form that is based on your query and set the form's Default View property to Datasheet View. It would look like a query and you will have the custom ribbon.
 

Users who are viewing this thread

Top Bottom