>Hello there
>
[quoted text clipped - 6 lines]
>
>Is there a way to do this on code?
Yes. I apologize to whoever I got this code from - you didn't identify
yourself in it and I've forgotten which website it was on, but it
works VERY well and I've used it routinely.
Public Function TurnOffSubDataSh() As Integer
Dim db As DAO.Database
Dim tdf As DAO.TableDef
Dim prp As DAO.Property
Const conPropName = "SubdatasheetName"
Const conPropValue = "[None]"
TurnOffSubDataSh = 0
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
TurnOffSubDataSh = TurnOffSubDataSh + 1
Else
If tdf.Properties(conPropName) <> conPropValue Then
tdf.Properties(conPropName) = conPropValue
TurnOffSubDataSh = TurnOffSubDataSh + 1
End If
End If
End If
End If
Next
Set prp = Nothing
Set tdf = Nothing
Set db = Nothing
End Function
John W. Vinson[MVP]