[AccessD] Change SubDatasheetName to [None] in code?

Charlotte Foust cfoust at infostatsystems.com
Mon Nov 22 10:43:51 CST 2004


Um ... Is it too late to point out that there is code in on-line help to
turn off the subdatasheet for a table.  It's easy enough to expand that
to the entire database.  I've done it a couple of slightly different
ways, but I only found the code in help after I had built virtually the
same code on my own.

Charlotte Foust


-----Original Message-----
From: Dan Waters [mailto:dwaters at usinternet.com] 
Sent: Saturday, November 20, 2004 9:44 AM
To: 'Database Advisors'
Subject: [AccessD] Change SubDatasheetName to [None] in code?


Happy Thanksgiving to everyone!

 

I want to write a utility sub to change the SubDatasheetName property in
tables to [None].  I'm trying to use the code below, but get an error of
'The object is closed or does not exist' at the code line beginning Set
prp =.  The table is open and in Design view.

 

    Dim obj As AccessObject

    Dim prp As DAO.Property

    Dim stgName As String

    

    For Each obj In CurrentData.AllTables

        stgName = obj.Name

        DoCmd.OpenTable stgName, acViewDesign, acEdit

        Set prp = obj.CreateProperty("SubDatasheetName", dbText,
"[None]")

        DoCmd.Close acTable, stgName, acSaveYes

    Next

 

Can this be done?

 

Thanks,

Dan Waters

ProMation Systems, Inc.

-- 
_______________________________________________
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