adraughn
asked on
Loop thru tables / subdatasheet property check
Is it possible to write something that will loop thru all of my existing tables and set the subdatasheet property to none?
someone else is working on the project with me and has made it a habit to create tables without changing this property. i don't want to have to check them all of the time. I know I can use mSysObjects to return all of the table names but am stuck after that.
-a
someone else is working on the project with me and has made it a habit to create tables without changing this property. i don't want to have to check them all of the time. I know I can use mSysObjects to return all of the table names but am stuck after that.
-a
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
And KUDOS for just saying NO to SubDataSheets !!
Might as well throw in this also - just say NO to Zero Length Strings:
Function SSF_TurnOffAllowZeroLenStr ing()
Dim tdf As DAO.TableDef
Dim fld As DAO.Field
Dim prp As DAO.Property
Const conPropName = "AllowZeroLength"
Const conPropValue = False
For Each tdf In CurrentDb.TableDefs
If (tdf.Attributes And dbSystemObject) = 0 Then
Debug.Print tdf.Name
For Each fld In tdf.Fields
If fld.Properties(conPropName ) Then
Debug.Print tdf.Name & "." & fld.Name
fld.Properties(conPropName ) = False
End If
Next
End If
Next
Set prp = Nothing
Set fld = Nothing
Set tdf = Nothing
MsgBox "Turn off Allow Zero Length String complete."
End Function
Might as well throw in this also - just say NO to Zero Length Strings:
Function SSF_TurnOffAllowZeroLenStr
Dim tdf As DAO.TableDef
Dim fld As DAO.Field
Dim prp As DAO.Property
Const conPropName = "AllowZeroLength"
Const conPropValue = False
For Each tdf In CurrentDb.TableDefs
If (tdf.Attributes And dbSystemObject) = 0 Then
Debug.Print tdf.Name
For Each fld In tdf.Fields
If fld.Properties(conPropName
Debug.Print tdf.Name & "." & fld.Name
fld.Properties(conPropName
End If
Next
End If
Next
Set prp = Nothing
Set fld = Nothing
Set tdf = Nothing
MsgBox "Turn off Allow Zero Length String complete."
End Function
ASKER
joe:
i'm using 2k. bugged out on:
Dim db As DAO.Database
user defined type not defined.
-a
i'm using 2k. bugged out on:
Dim db As DAO.Database
user defined type not defined.
-a
ASKER
koutny:
same error as joe's. on this line:
Dim MyDB As DAO.Database
same error as joe's. on this line:
Dim MyDB As DAO.Database
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
kudos joe, thanks....
https://www.experts-exchange.com/questions/23387790/Modify-Access-2003-tables-programmatically-from-VB6.html
I'll check on the property setting
OM Gang