Anyone know a way that I can create a ribbon that shows up whenever a query is open? I've done this with Reports and Forms, but queries have me stumped as there is no "Other" property tab for a query in design, or table view.![]()
Anyone know a way that I can create a ribbon that shows up whenever a query is open? I've done this with Reports and Forms, but queries have me stumped as there is no "Other" property tab for a query in design, or table view.![]()
Someday I'll understand everything...
![]()
![]()
Even then...I'll still pretend I'm a beginner.
If you want to control the visibility of a tab, you need to do it via VBA callbacks. That suggests to me that you need to issue the query from VBA.
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
Currently the query is issued from the Ribbon callback function HandleQueryAction(VBA module in basRibbonCommands). MSDN says I need to use a getVisible="getVisibleCallback" function. However the example it gives is based on a date. I need to know if the current screen is a datasheet view of a query. Now I can assume that because the HandleQueryAction is called that a query was opened, but that still doesn't hide the tab when the query is closed again.
Someday I'll understand everything...
![]()
![]()
Even then...I'll still pretend I'm a beginner.
What do you mean by a Datasheet view of a query?
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber
If you run a simple select query, you get a datasheet view. I was hoping that I could restrict the "TabExternalData" to objects that I felt could be exported, query results and reports but not available for forms.
I might just give up on this though as I don't see any way of binding it to anything... unless I created a form... doh. Silly me. I'll just create a form with the query as the recordset and display it in datasheet mode only.
Someday I'll understand everything...
![]()
![]()
Even then...I'll still pretend I'm a beginner.
How about trapping the worksheet activate event and if it is that sheet, make the tab visible?
____________________________________________
Nihil simul inventum est et perfectum
Abusus non tollit usum
Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
James Thurber