A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How do I display the "hidden" attribute?



 
 
Thread Tools Display Modes
  #1  
Old May 6th, 2004, 12:11 AM
Frank Martin
external usenet poster
 
Posts: n/a
Default How do I display the "hidden" attribute?

I have some hidden objects (tables, Queries, Forms, Reports) that I hid long
ago to tidy the screen, and I want to delete these.

There are so many
objects on the screen that I need some way of displaying the "Hidden"
attribute to save trawling through all of them.

I cannot find how to do
this. Can someone point me in the right direction. Regards, Frank



  #2  
Old May 6th, 2004, 01:37 AM
Jessestonecedar
external usenet poster
 
Posts: n/a
Default How do I display the "hidden" attribute?

Try grouping the hidden tables, etc. Create a new group and place them there.
This is for the future. You're probably stuck now unless you write a procedure
scroll through all files and delete those marked hidden,
  #3  
Old May 6th, 2004, 08:09 AM
Graham R Seach
external usenet poster
 
Posts: n/a
Default How do I display the "hidden" attribute?

Frank,

I've only tested deleting the tables, but it should work.

Public Sub KillHiddenObjects()
Dim db As Database
Dim rs As DAO.Recordset
Dim sSQL As String
Dim sPlace As String

On Error GoTo Proc_Err

Set db = CurrentDb

'*** Kill the Tables ********************
sPlace = "deleting the tables."
sSQL = "SELECT [Name] FROM MSysObjects WHERE [Type] = 1 AND Flags = 8"
Set rs = db.OpenRecordset(sSQL, dbOpenSnapshot)

Do While Not rs.EOF
db.TableDefs.Delete rs!Name
rs.MoveNext
Loop
db.TableDefs.Refresh
rs.Close

'*** Kill the Queries ********************
sPlace = "deleting the queries."
sSQL = "SELECT [Name] FROM MSysObjects WHERE [Type] = 5 AND Flags = 8"
Set rs = db.OpenRecordset(sSQL, dbOpenSnapshot)

Do While Not rs.EOF
db.QueryDefs.Delete rs!Name
rs.MoveNext
Loop
db.QueryDefs.Refresh
rs.Close

'*** Kill the Forms ********************
sPlace = "deleting the forms."
sSQL = "SELECT [Name] FROM MSysObjects WHERE [Type] = -32768 AND Flags =
8"
Set rs = db.OpenRecordset(sSQL, dbOpenSnapshot)

Do While Not rs.EOF
DoCmd.DeleteObject acForm, rs!Name
rs.MoveNext
Loop
rs.Close

'*** Kill the Reports ********************
sPlace = "deleting the reports."
sSQL = "SELECT [Name] FROM MSysObjects WHERE [Type] = -32764 AND Flags =
8"
Set rs = db.OpenRecordset(sSQL, dbOpenSnapshot)

Do While Not rs.EOF
DoCmd.DeleteObject acReport, rs!Name
rs.MoveNext
Loop
rs.Close

'*** Kill the Data Access Pages ********************
sPlace = "deleting the data access pages."
sSQL = "SELECT [Name] FROM MSysObjects WHERE [Type] = -32756 AND Flags =
8"
Set rs = db.OpenRecordset(sSQL, dbOpenSnapshot)

Do While Not rs.EOF
'Kill the physical file
Kill Access.CurrentProject.AllDataAccessPages(rs!Name). FullName
DoCmd.DeleteObject acDataAccessPage, rs!Name
rs.MoveNext
Loop
rs.Close

'*** Kill the Macros ********************
sPlace = "deleting the macros."
sSQL = "SELECT [Name] FROM MSysObjects WHERE [Type] = -32766 AND Flags =
8"
Set rs = db.OpenRecordset(sSQL, dbOpenSnapshot)

Do While Not rs.EOF
DoCmd.DeleteObject acMacro, rs!Name
rs.MoveNext
Loop
rs.Close

'*** Kill the Macros ********************
sSQL = "SELECT [Name] FROM MSysObjects WHERE [Type] = -32761 AND Flags =
8"
Set rs = db.OpenRecordset(sSQL, dbOpenSnapshot)

Do While Not rs.EOF
DoCmd.DeleteObject acModule, rs!Name
rs.MoveNext
Loop

Proc_Exit:
On Error Resume Next
rs.Close
Set rs = Nothing
Set db = Nothing
Exit Sub

Proc_Err:
DoCmd.Beep
MsgBox "An error " & Err.Number & " occurred while " & sPlace & _
vbCrLf & vbCrLf & Err.Description, _
vbOKOnly + vbExclamation, "Something went wrong!"
Resume Proc_Exit
End Sub

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyT...764559036.html


"Frank Martin" wrote in message
...
I have some hidden objects (tables, Queries, Forms, Reports) that I hid

long
ago to tidy the screen, and I want to delete these.

There are so many
objects on the screen that I need some way of displaying the "Hidden"
attribute to save trawling through all of them.

I cannot find how to do
this. Can someone point me in the right direction. Regards, Frank





  #4  
Old May 7th, 2004, 02:00 AM
Frank Martin
external usenet poster
 
Posts: n/a
Default How do I display the "hidden" attribute?

Many thanks for this; I'll try it soon.
Regards, Frank


"Graham R Seach" wrote in message
...
Frank,

I've only tested deleting the tables, but it should work.

Public Sub KillHiddenObjects()
Dim db As Database
Dim rs As DAO.Recordset
Dim sSQL As String
Dim sPlace As String

On Error GoTo Proc_Err

Set db = CurrentDb

'*** Kill the Tables ********************
sPlace = "deleting the tables."
sSQL = "SELECT [Name] FROM MSysObjects WHERE [Type] = 1 AND Flags = 8"
Set rs = db.OpenRecordset(sSQL, dbOpenSnapshot)

Do While Not rs.EOF
db.TableDefs.Delete rs!Name
rs.MoveNext
Loop
db.TableDefs.Refresh
rs.Close

'*** Kill the Queries ********************
sPlace = "deleting the queries."
sSQL = "SELECT [Name] FROM MSysObjects WHERE [Type] = 5 AND Flags = 8"
Set rs = db.OpenRecordset(sSQL, dbOpenSnapshot)

Do While Not rs.EOF
db.QueryDefs.Delete rs!Name
rs.MoveNext
Loop
db.QueryDefs.Refresh
rs.Close

'*** Kill the Forms ********************
sPlace = "deleting the forms."
sSQL = "SELECT [Name] FROM MSysObjects WHERE [Type] = -32768 AND Flags

=
8"
Set rs = db.OpenRecordset(sSQL, dbOpenSnapshot)

Do While Not rs.EOF
DoCmd.DeleteObject acForm, rs!Name
rs.MoveNext
Loop
rs.Close

'*** Kill the Reports ********************
sPlace = "deleting the reports."
sSQL = "SELECT [Name] FROM MSysObjects WHERE [Type] = -32764 AND Flags

=
8"
Set rs = db.OpenRecordset(sSQL, dbOpenSnapshot)

Do While Not rs.EOF
DoCmd.DeleteObject acReport, rs!Name
rs.MoveNext
Loop
rs.Close

'*** Kill the Data Access Pages ********************
sPlace = "deleting the data access pages."
sSQL = "SELECT [Name] FROM MSysObjects WHERE [Type] = -32756 AND Flags

=
8"
Set rs = db.OpenRecordset(sSQL, dbOpenSnapshot)

Do While Not rs.EOF
'Kill the physical file
Kill Access.CurrentProject.AllDataAccessPages(rs!Name). FullName
DoCmd.DeleteObject acDataAccessPage, rs!Name
rs.MoveNext
Loop
rs.Close

'*** Kill the Macros ********************
sPlace = "deleting the macros."
sSQL = "SELECT [Name] FROM MSysObjects WHERE [Type] = -32766 AND Flags

=
8"
Set rs = db.OpenRecordset(sSQL, dbOpenSnapshot)

Do While Not rs.EOF
DoCmd.DeleteObject acMacro, rs!Name
rs.MoveNext
Loop
rs.Close

'*** Kill the Macros ********************
sSQL = "SELECT [Name] FROM MSysObjects WHERE [Type] = -32761 AND Flags

=
8"
Set rs = db.OpenRecordset(sSQL, dbOpenSnapshot)

Do While Not rs.EOF
DoCmd.DeleteObject acModule, rs!Name
rs.MoveNext
Loop

Proc_Exit:
On Error Resume Next
rs.Close
Set rs = Nothing
Set db = Nothing
Exit Sub

Proc_Err:
DoCmd.Beep
MsgBox "An error " & Err.Number & " occurred while " & sPlace & _
vbCrLf & vbCrLf & Err.Description, _
vbOKOnly + vbExclamation, "Something went wrong!"
Resume Proc_Exit
End Sub

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia

Microsoft Access 2003 VBA Programmer's Reference
http://www.wiley.com/WileyCDA/WileyT...764559036.html


"Frank Martin" wrote in message
...
I have some hidden objects (tables, Queries, Forms, Reports) that I hid

long
ago to tidy the screen, and I want to delete these.

There are so many
objects on the screen that I need some way of displaying the "Hidden"
attribute to save trawling through all of them.

I cannot find how to do
this. Can someone point me in the right direction. Regards, Frank







 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:51 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.