question

ForssPeterNova-6572 avatar image
0 Votes"
ForssPeterNova-6572 asked ForssPeterNova-6572 commented

Access 64 bit, VBA code to set SubDataSheet to None in all tables

I want code to set the SubDataSheet to None in Access tables. I know how to do it in 32 bit. But need to to the same in Access 64.

office-vba-devoffice-access-dev
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.


Maybe you can use the same code.

0 Votes 0 ·

Hi Viorel-1,

Same code yes, but needed the MS Office 16.0 Access database engine Object Library

0 Votes 0 ·

1 Answer

ForssPeterNova-6572 avatar image
0 Votes"
ForssPeterNova-6572 answered

Had this solution from Gustav at UtterAccess:


Use: Microsoft Office 16.0 Access database engine Object Library

Then this code:

 Public Sub RemoveSubdatasheetNames()
    
     Dim Table      As DAO.TableDef
     Dim Property    As DAO.Property
        
     For Each Table In CurrentDb.TableDefs
         If Table.SourceTableName = "" Then
             For Each Property In Table.Properties
                 If Property.Name = "SubdatasheetName" Then
                     Exit For
                 End If
             Next
             If Property Is Nothing Then
                 Set Property = Table.CreateProperty("SubdatasheetName", dbText, "[None]")
                 Table.Properties.Append Property
             Else
                 Property.Value = "[None]"
             End If
         End If
     Next
        
 End Sub
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.