Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Database Design / February 2004

Tip: Looking for answers? Try searching our database.

Remove subdatasheet column from a table

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Vic - 11 Feb 2004 16:56 GMT
Is it possible to remove the subdatasheet column from the table view for tables with existing relationships? The additional column usually has "+" in the field which, I'd like to remove
Allen Browne - 12 Feb 2004 04:59 GMT
Good move! Subdatasheets can be a performance and security issue.

1. Open each table in design view.
2. Open the Properties box (View menu).
3. Set the Subdatasheet Name to:
       [None]
If your database is split, do this on the back end mdb.

Alternatively you can set the property for all tables in your database
programmatically:

Function TurnOffSubDataSh()
   Dim db As DAO.Database
   Dim tdf As DAO.TableDef
   Dim prp As DAO.Property
   Const conPropName = "SubdatasheetName"
   Const conPropValue = "[None]"

   Set db = DBEngine(0)(0)
   For Each tdf In db.TableDefs
       If (tdf.Attributes And dbSystemObject) = 0 Then
           If tdf.Connect = vbNullString And Asc(tdf.Name) <> 126 Then 'Not
attached, or temp.
               If Not HasProperty(tdf, conPropName) Then
                   Set prp = tdf.CreateProperty(conPropName, dbText,
conPropValue)
                   tdf.Properties.Append prp
               Else
                   If tdf.Properties(conPropName) <> conPropValue Then
                       tdf.Properties(conPropName) = conPropValue
                   End If
               End If
           End If
       End If
   Next

   Set prp = Nothing
   Set tdf = Nothing
   Set db = Nothing
End Function

Public Function HasProperty(obj As Object, strPropName As String) As Boolean
   'Purpose:   Return true if the object has the property.
   Dim varDummy As Variant

   On Error Resume Next
   varDummy = obj.Properties(strPropName)
   HasProperty = (Err.Number = 0)
End Function

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> Is it possible to remove the subdatasheet column from the table view for tables with existing relationships? The additional column usually has "+" in
the field which, I'd like to remove
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.