Per RoyVidar:
When I encounteered it, I thought it was due to Access version. I think
in Access 2003, I had to set it programatically, while in 2000 and
2002, I could do it in design view.
currentdb.tabledefs("yourtbl").properties("subdat asheetname").value =
"[none]"
That did the trick... Thanks!
================================================== ========
Public Sub SubDataSheetZap()
Dim thisDB As DAO.Database
Dim curTD As DAO.TableDef
Dim newProp As DAO.Property
Dim i As Long
Dim k As Long
Const myNone = "[None]"
Const newPropName = "SubDataSheetname"
DoCmd.Hourglass True
Set thisDB = CurrentDb()
SysCmd acSysCmdInitMeter, "Zapping SubDataSheet Names...",
thisDB.TableDefs.Count
For i = 0 To thisDB.TableDefs.Count - 1
Set curTD = thisDB.TableDefs(i)
If Left$(curTD.Name,4) <> "Msys" then
If tablePropExist(newPropName, curTD) Then
curTD.Properties(newPropName) = myNone
Else
Set newProp = curTD.CreateProperty(newPropName, dbText, myNone)
curTD.Properties.Append newProp
Set newProp = Nothing
End If
End If
k = k + 1
SysCmd acSysCmdUpdateMeter, i
Next i
SysCmd acSysCmdRemoveMeter
Set curTD = Nothing
Set newProp = Nothing
DoCmd.Hourglass False
MsgBox k & " tables updated", , "Done"
End Sub
Private Function tablePropExist(ByVal thePropName As String, ByRef theTD As
DAO.TableDef) As Boolean
Dim myProp As DAO.Property
On Error Resume Next
Set myProp = theTD.Properties(thePropName)
On Error GoTo 0
If Not myProp Is Nothing Then
tablePropExist = True
End If
End Function
================================================== ========
--
PeteCresswell