Minggu, 08 November 2015

Re:[MS_AccessPros] Re: Changing the Subdatasheet property of all tables to [None]

 

Bill-
Thanks a lot.
Best Regards,
Kevin



发自我的小米手机
在 "wrmosca@comcast.net [MS_Access_Professionals]" <MS_Access_Professionals@yahoogroups.com>,2015年11月9日 上午12:26写道:

 

Kevin


Here is a procedure I wrote years ago to turn off Subdatasheets in all tables.

Public Function dev_TbrTurnOffSubDataSheets()
'Purpose  : Access sets all tables' SubDataSheets to Auto which slows up loading time.
'           This function will set the property to [none].
'DateTime : 1/14/2004 09:20
'Author   : Bill Mosca
    Dim db As DAO.Database
    Dim prop As DAO.Property
    Dim propName As String, propVal As String
    Dim propType As Integer, i As Integer

    On Error Resume Next

    Set db = CurrentDb

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


    For i = 0 To db.TableDefs.Count - 1

        If (db.TableDefs(i).Attributes And dbSystemObject) = 0 Then

            If db.TableDefs(i).Properties(propName).Value <> propVal Then
                db.TableDefs(i).Properties(propName).Value = propVal
            End If

            If Err.Number = 3270 Then
                Err.Clear
                Set prop = db.TableDefs(i).CreateProperty(propName)
                prop.Type = propType
                prop.Value = propVal
                db.TableDefs(i).Properties.Append prop
            Else
                If Err.Number <> 0 Then
                    Resume Next
                End If
            End If

        End If
    Next i

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

    Set prop = Nothing
    Set db = Nothing

End Function

I put the module that contains this and many other development routines in our Files folder. It's named DevToolbar.zip. If you import it into your database you can run any of the routines. There is also a 2003 toolbar that you can import. For veriosn 2007 and higher the toolbar will show up under Add-ins tab.

Regards,
Bill Mosca, Founder - MS_Access_Professionals
http://www.thatlldoit.com
Microsoft Office Access MVP
http://mvp.microsoft.com/en-us/mvp/Bill%20Mosca-35852
My nothing-to-do-with-Access blog
http://wrmosca.wordpress.com

 



---In MS_Access_Professionals@yahoogroups.com, <zhaoliqingoffice@163.com> wrote :

John-
Changing the Subdatasheet property of all tables to [None], will this cause any problem to the tables? Thanks.
Best Regards,
Kevin


zhaoliqingoffice@163.com

__._,_.___

Posted by: Kevin <zhaoliqingoffice@163.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (7)

.

__,_._,___

Tidak ada komentar:

Posting Komentar