Karen,
The code below will iterate through all your tables and turn the [auto] to
none. I believe I got the code from Allan Brown's site.
Maybe this will help you.
Regards,
Barry
Public Function TurnOffSubDataS h()
Dim db As DAO.Database
Dim tdf As DAO.TableDef
Dim prp As DAO.Property
Dim vCnt As Long
Const conPropName = "SubdatasheetNa me"
Const conPropValue = "[None]"
vStarted = Timer
HourGlass_On
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.CreatePrope rty(conPropName , dbText, conPropValue)
tdf.Properties. Append prp
Else
If tdf.Properties( conPropName) <> conPropValue Then
tdf.Properties( conPropName) = conPropValue
End If
End If
End If
End If
vCnt = vCnt + 1
Next tdf
Set prp = Nothing
Set tdf = Nothing
Set db = Nothing
vFinished = Timer
HourGlass_Off
MsgBox "Procedure Complete! " & vCnt, vbInformation, "Time: " &
Format((vFinish ed - vStarted), "fixed") & " Seconds"
End Function
Public Function HasProperty(obj As Object, strPropName As String) As Boolean
'Purpose: Return true if the object has the property.
Dim varDummy As Variant
On Error Resume Next
varDummy = obj.Properties( strPropName)
HasProperty = (Err.Number = 0)
End Function
"karen scheu via AccessMonster.c om" <fo***@AccessMo nster.com> wrote in
message news:54******** ***@AccessMonst er.com...
I am having trouble lately opening my local tables. It is taking a a few
seconds to open the table that has no records in it. I read that there is a
bug with the AutoCorrect feature and so I set that option off in my DB which
is an Access 2002-2003 database, then tried to set the subdatasheet to none,
but every time I get back into it, it goes back to Auto. How can I set it
to
none and have it stay. I also tried creating a new MDB and setting the
option first then importing the table and setting the subdatasheet to None
and it still does not save.
Please help. I don't really even know if this will resolve my problem yet.
Thanks.
--
Message posted via AccessMonster.c om
http://www.accessmonster.com/Uwe/For...ccess/200509/1