S
strive4peace
thanks, Gunny
(hope you don't mind since you don't know me... your
reputation preceeds you and I have read some of your posts, they're great!)
I did a Google search on Allen's site and found this... not sure if this
is what you were thinking of...it is VERY interesting and I thank you
for the direction...
link: Database Issue Checker Utility by Allen Browne
http://allenbrowne.com/AppIssueChecker.html
"This free utility (125KB zipped) reports on potential issues with the
structure of Access databases. It makes no changes to the databases you
examine..."
It does include a check for the Subdatasheet property
after seeing what the property name was from Allen's code, I put this
little procedure together and tested it...
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Public Sub SetSubDatsheetNone()
'crystal 10-27-06
'strive4peace2006 at yahoo dot com
'set the Subdatasheet property to [None]
'in all user tables
Dim db As DAO.Database _
, tdf As DAO.TableDef _
, mProp As DAO.Property
Dim mCountDone As Integer _
, mCountChecked As Integer _
, mBoo As Boolean _
, mStr As String
'cheap but it works <g>
On Error Resume Next
mCountDone = 0
mCountChecked = 0
For Each tdf In CurrentDb.TableDefs
'skip Microsoft System tables
If Left(tdf.Name, 4) <> "Msys" Then
mBoo = False
mCountChecked = mCountChecked + 1
Err.Number = 0
mStr = tdf.Properties("SubdatasheetName")
If Err.Number > 0 Then
Set mProp = tdf.CreateProperty( _
"SubdatasheetName", dbText, "[None]")
tdf.Properties.Append mProp
mBoo = True
Else
'thanks, Allen!
If tdf.Properties("SubdatasheetName") <> "[None]" Then
tdf.Properties("SubdatasheetName") = "[None]"
mBoo = True
End If
End If
If mBoo = True Then
mCountDone = mCountDone + 1
End If
End If
Next tdf
Set mProp = Nothing
Set tdf = Nothing
Set db = Nothing
MsgBox mCountChecked & " tables checked" & vbCrLf & vbCrLf _
& "Reset SubdatasheetName property to [None] in " _
& mCountDone & " tables" _
, , "Reset Subdatasheet to None"
End Sub
'~~~~~~~~~~~~~~~~~~~~~~
Warm Regards,
Crystal
*
have an awesome day ![Smile :) :)](/styles/default/custom/smilies/smile.gif)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
![Wink ;) ;)](/styles/default/custom/smilies/wink.gif)
reputation preceeds you and I have read some of your posts, they're great!)
I did a Google search on Allen's site and found this... not sure if this
is what you were thinking of...it is VERY interesting and I thank you
for the direction...
link: Database Issue Checker Utility by Allen Browne
http://allenbrowne.com/AppIssueChecker.html
"This free utility (125KB zipped) reports on potential issues with the
structure of Access databases. It makes no changes to the databases you
examine..."
It does include a check for the Subdatasheet property
after seeing what the property name was from Allen's code, I put this
little procedure together and tested it...
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Public Sub SetSubDatsheetNone()
'crystal 10-27-06
'strive4peace2006 at yahoo dot com
'set the Subdatasheet property to [None]
'in all user tables
Dim db As DAO.Database _
, tdf As DAO.TableDef _
, mProp As DAO.Property
Dim mCountDone As Integer _
, mCountChecked As Integer _
, mBoo As Boolean _
, mStr As String
'cheap but it works <g>
On Error Resume Next
mCountDone = 0
mCountChecked = 0
For Each tdf In CurrentDb.TableDefs
'skip Microsoft System tables
If Left(tdf.Name, 4) <> "Msys" Then
mBoo = False
mCountChecked = mCountChecked + 1
Err.Number = 0
mStr = tdf.Properties("SubdatasheetName")
If Err.Number > 0 Then
Set mProp = tdf.CreateProperty( _
"SubdatasheetName", dbText, "[None]")
tdf.Properties.Append mProp
mBoo = True
Else
'thanks, Allen!
If tdf.Properties("SubdatasheetName") <> "[None]" Then
tdf.Properties("SubdatasheetName") = "[None]"
mBoo = True
End If
End If
If mBoo = True Then
mCountDone = mCountDone + 1
End If
End If
Next tdf
Set mProp = Nothing
Set tdf = Nothing
Set db = Nothing
MsgBox mCountChecked & " tables checked" & vbCrLf & vbCrLf _
& "Reset SubdatasheetName property to [None] in " _
& mCountDone & " tables" _
, , "Reset Subdatasheet to None"
End Sub
'~~~~~~~~~~~~~~~~~~~~~~
Warm Regards,
Crystal
*
![Smile :) :)](/styles/default/custom/smilies/smile.gif)
![Smile :) :)](/styles/default/custom/smilies/smile.gif)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
strive4peace said:care to post the code to reset all
table's subdatasheet property to [None]?
It's on Allen Browne's site. Sorry I don't have the URL to hand.