Hidden queries are unhidden

S

sam.alame

Hello,

I have the following code that runs from an external database to
change the SQL of a query. The query I'm modifying is originally
hidden. After the SQL is changed, the query becomes unhidden for some
reason. Is there any way around this? If not, how do I remotely hide
the queries after modifying them?

Function ModififyTerr(DBName As String)
Dim DB As Database, qdf As QueryDef
Set DB = DBEngine.Workspaces(0).OpenDatabase(DBName)
Set qdf = DB.QueryDefs("TblName")
qdf.SQL = "SELECT MSysObjects.Name FROM MSysObjects WHERE
(((MSysObjects.Flags) In (0,16,128)) AND ((MSysObjects.Type)=1 Or
(MSysObjects.Type)=5));"
qdf.Close
End Function

Thanks you,
Sam
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top