Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you set a query to be hidden in VBA?

Status
Not open for further replies.

monsjic

Programmer
Jan 23, 2002
23
0
0
US
I know how to do this to tables, but I can't get it to work for queries. How can I set the query attributes of hidden to be true?

Thanks
 
Hi monsjic,

Why do you want to hide the query? If it's an action query you won't see anything at all, so you would only need to hide a select query?

 
Are you talking about the confirmations of an action query? Like "You are about to delete 150 records from the orders table, do you wish to continue?"

If so, you can do this:

==========
DoCmd.SetWarnings False
DoCmd.OpenQuery "YourQuery"
DoCmd.SetWarnings True
==========

OR, I recommend this instead, becuase SetWarnings will eliminate any response from the database, even an error you may want to see. Where as the SetOption only affects the action queries.

==========
Application.SetOption "Confirm Action Queries", False
DoCmd.OpenQuery "YourQuery"
Application.SetOption "Confirm Action Queries", True
==========

Don't know if that's what you are looking for or not. Jim Lunde
compugeeks@hotmail.com
We all agree your theory is crazy, but is it crazy enough?
 
i understand that you would like to hide the query for security metters.

i know how to change the attribute for tables and i'll try to do so for queries.

i'll let u know if i'll find a way... :>

esakal
 
I want to hide them because I like the added security. I do not want to supress confirmations(i.e. set the warnings to false).
 
Hi!

I'm using A2K and when I right click on a query and choose properties, one of the attributes is hidden. If I check the box the query is hidden. Does that help?

Jeff Bridgham
bridgham@purdue.edu
 
I want to be able to change the hidden attribute property programatically using VBA. As I stated before, I do not want to supress warning messages.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top