[AccessD] mdb speed

John Colby jcolby at colbyconsulting.com
Mon Oct 20 10:44:05 CDT 2003


I assume this has to be inserted into a module in the BE and run with the BE
open?

John W. Colby
www.colbyconsulting.com

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Kath Pelletti
Sent: Monday, October 20, 2003 8:56 AM
To: AccessD at databaseadvisors.com
Subject: [AccessD] mdb speed


I deleted the message from marcel(?) too fast - but Marcel here is some code
previously posted to the list to turn off all subdatasheets in your tables,
ie. to set the name of the subdatasheet name to "None".
(Sorry - can't credit original author...)

Marcel - there have been some really good posts to the list on speed and
performance issues - maybe a search for 'speed' in the archives would be of
some help to you?

Kath

Function TurnOffSubDataSheets()
  Dim MyDB As DAO.Database
  Dim MyProperty As DAO.Property

  Dim propName As String
  Dim PropType As Integer
  Dim propVal As String

  Dim strS As String

  Set MyDB = CurrentDb

  propName = "SubDataSheetName"
  PropType = 10
  propVal = "[NONE]"

  On Error Resume Next

  For I = 0 To MyDB.TableDefs.Count - 1

      If (MyDB.TableDefs(I).Attributes And dbSystemObject) = 0 Then

          If MyDB.TableDefs(I).Properties(propName).Value <> propVal Then
             MyDB.TableDefs(I).Properties(propName).Value = propVal
             intChangedTables = intChangedTables + 1
          End If

          If Err.Number = 3270 Then
             Set MyProperty = MyDB.TableDefs(I).CreateProperty(propName)
             MyProperty.Type = PropType
             MyProperty.Value = propVal
             MyDB.TableDefs(I).Properties.Append MyProperty
          Else
             If Err.Number <> 0 Then
                 MsgBox "Error: " & Err.Number & " on Table " _
                 & MyDB.TableDefs(I).Name & "."
                 MyDB.Close
                 Exit Function
             End If
          End If

      End If
  Next I

MsgBox "The " & propName & _
" value for all non-system tables has been updated to " & propVal & "."

MyDB.Close

End Function




Kath Pelletti
Software Design & Solutions Pty Ltd.
Ph: 9505-6714
Fax: 9505-6430
sdssoftware at optusnet.com.au
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com





More information about the AccessD mailing list