Consulting

Results 1 to 6 of 6

Thread: Solved: Attach Specific Ribbon to Query objects?

  1. #1
    VBAX Expert Imdabaum's Avatar
    Joined
    Jun 2006
    Posts
    652
    Location

    Solved: Attach Specific Ribbon to Query objects?

    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.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    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

  3. #3
    VBAX Expert Imdabaum's Avatar
    Joined
    Jun 2006
    Posts
    652
    Location
    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.

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    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

  5. #5
    VBAX Expert Imdabaum's Avatar
    Joined
    Jun 2006
    Posts
    652
    Location
    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.

  6. #6
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •