Hiding Queries by VBA

Hello everyone, I use this code for hiding Queries   [   Application.SetHiddenAttribute acQuery, "MyQuery", True    ] but the problem is when I right click I can show all object hiding then I can see again, did there is another VBA code to hide all my queries and can show again by VBA again?
adamdaban dabanStudentAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
<<did there is another VBA code to hide all my queries and can show again by VBA again?>>

 No, there really is no way to do that.   If you really want to hide things, you can create the querydefs in code, then delete the querydefs when your done.

Jim.
1
Anders Ebro (Microsoft MVP)Microsoft DeveloperCommented:
Most people will create a user form to act as a menu, or simply use the ribbon, and then hide the navigation pane entirely. The navigation pane in my opinion is only really for the developer.
1
Fabrice LambertFabrice LambertCommented:
Hide the navigation panel:
DoCmd.SelectObject acTable, "MyTable", True
DoCmd.RunCommand acCmdWindowHide

Open in new window

Bring it back:
DoCmd.SelectObject acTable, InDatabaseWindow:=True

Open in new window

1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
adamdaban dabanStudentAuthor Commented:
Thanks for all of you and excellent advice
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.