Results 1 to 12 of 12

Thread: How to hide Queries...

  1. #1

    Thread Starter
    Hyperactive Member nagasrikanth's Avatar
    Join Date
    Nov 2004
    Location
    India,Hyderabad.
    Posts
    420

    Lightbulb How to hide Queries...

    Hi all,

    Here i was strugling with hiding of queries..It sounds simple..but it is a big task for me,since i have around 100 queries to hide.I dont want to open each and every query and make its hidden property to true..

    for hiding tables i used
    VB Code:
    1. tbldefs.attrirbutes=dbhiddentobject

    Like wise dont i have any simple command for hiding queries also ???

    Quick help in this regard will be greatly Appriciated.

    Thanx & Regards
    Srikanth.
    The Difference between a Successful person and others is not a Lack of Knowledge,
    But rather a Lack of WILL

  2. #2
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    2,024

    Re: How to hide Queries...

    HI,

    do you mean to say you want to hide the queries in your database window? Are you using MS Access? Am I correct on this?


    CodeBank: VB.NET & C#.NET | ASP.NET
    Programming: C# | VB.NET
    Blogs: Personal | Programming
    Projects: GitHub | jsFiddle
    ___________________________________________________________________________________

    Rating someone's post is a way of saying Thanks...

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: How to hide Queries...

    Sure

    Check out my CodeBank entry on hiding db objects for Access.

    http://www.vbforums.com/showthread.php?t=350669

    Just use the QueryDefs collection instead of TableDefs.
    It hides object even if you select the option > "Show Hidden Objects" so dont forget your object name.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  4. #4

    Thread Starter
    Hyperactive Member nagasrikanth's Avatar
    Join Date
    Nov 2004
    Location
    India,Hyderabad.
    Posts
    420

    Re: How to hide Queries...

    Hi rob,

    Thanks for the code..

    but this was not getting successed when i use Query Def instead of tabledef.

    VB Code:
    1. Application.CurrentDb.querydefs(Q_Name).Properties("Attributes").Value = dbHiddenObject

    what i have to do...

    n,KG...

    Yep..u r perfectly right..Im using Access only..

    Thanks & Regards
    Srikanth
    The Difference between a Successful person and others is not a Lack of Knowledge,
    But rather a Lack of WILL

  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: How to hide Queries...

    Yup, there doesnt "appear" to be a "attributes" property. Here are the available ones:

    NameMap
    DOL
    GUID
    DefaultView
    Orientation
    OrderByOn
    RecordLocks
    Prepare
    CacheSize
    StillExecuting
    MaxRecords
    RecordsAffected
    ODBCTimeout
    ReturnsRecords
    Connect
    Updatable
    SQL
    Type
    LastUpdated
    DateCreated
    Name

    I bet there is still something that designates if its hidden or not as if you right click on the query and select hidden. It would be that property but set to the different true hidden constant value.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  6. #6
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    2,024

    Re: How to hide Queries...

    Hi,,,

    How about just manually setting the hidden property of the queries...You do this by right clicking on the query and check it's hidden property..While not having figure out of the code...


    CodeBank: VB.NET & C#.NET | ASP.NET
    Programming: C# | VB.NET
    Blogs: Personal | Programming
    Projects: GitHub | jsFiddle
    ___________________________________________________________________________________

    Rating someone's post is a way of saying Thanks...

  7. #7
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    2,024

    Re: How to hide Queries...

    VB Code:
    1. Application.CurrentDb.QueryDefs(queryname).Properties("attributes").Value = dbHiddenObject

    RD,

    Is this code specific in DAO? Do you know the equivalent of that code in ADO? Maybe ADO has some functions enhanced compare to DAO...

    CodeBank: VB.NET & C#.NET | ASP.NET
    Programming: C# | VB.NET
    Blogs: Personal | Programming
    Projects: GitHub | jsFiddle
    ___________________________________________________________________________________

    Rating someone's post is a way of saying Thanks...

  8. #8
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: How to hide Queries...

    This code is Access Object Model. It doesnt appear to work yet for QueryDefs but in 2003 ADO and DAO are default references in a module.

    Did you check out the CodeBank link from post #3 yet?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  9. #9
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    2,024

    Re: How to hide Queries...

    Yep, the post was great and educational...

    What i mean is for the querydefs and not the tabledefs...I made a research in DAO and it seems to me that theres no attribute property for the querydefs as what you have stated in the previous post..So, i guess we have to stick to the manual hiding of objects huh...

    CodeBank: VB.NET & C#.NET | ASP.NET
    Programming: C# | VB.NET
    Blogs: Personal | Programming
    Projects: GitHub | jsFiddle
    ___________________________________________________________________________________

    Rating someone's post is a way of saying Thanks...

  10. #10

    Thread Starter
    Hyperactive Member nagasrikanth's Avatar
    Join Date
    Nov 2004
    Location
    India,Hyderabad.
    Posts
    420

    Re: How to hide Queries...

    is that finalized....
    Can't i have any other way..

    I have around hudreds of queries..
    selecting each and every one and making their property as hidden..is not a small task..
    isn't it??
    The Difference between a Successful person and others is not a Lack of Knowledge,
    But rather a Lack of WILL

  11. #11
    Frenzied Member KGComputers's Avatar
    Join Date
    Dec 2005
    Location
    Cebu, PH
    Posts
    2,024

    Re: How to hide Queries...

    I have around hudreds of queries..
    selecting each and every one and making their property as hidden..is not a small task..
    isn't it??
    Lots of queries you got there..Based on my research queries have no attributes property...I dont have a clue whether some of the experts here knows how to do that..If they do, well be pleased if they can share their knowledge..Maybe you can set them manually if you have extra time..

    I am hoping that new versions of access will be capable of doing a marquee selection on the objects like queries then changing the attributes..What do you think huh?

    CodeBank: VB.NET & C#.NET | ASP.NET
    Programming: C# | VB.NET
    Blogs: Personal | Programming
    Projects: GitHub | jsFiddle
    ___________________________________________________________________________________

    Rating someone's post is a way of saying Thanks...

  12. #12
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: How to hide Queries...

    You may want to check into ADOX and see if you can gain access to some attribute property for the queries that way.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

Posting Permissions

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



Click Here to Expand Forum to Full Width