Open the table in design view.
Open the Properties box (View menu).
Set the Subdatasheet Name property to:
[None]
This thing got there in Access 2000, because MS thought it might be
useful. They did not bother documenting how slow it makes everything, or
the lack of events for these things, and they turned in on by default, so
you now have to turn it off every time you create a table.
If you want to turn it off programmatically for all tables in your
database, this should do it:
Function TurnOffSubDataSh()
Dim db As DAO.Database
Dim tdf As DAO.TableDef
Dim prp As DAO.Property
Const conPropName = "SubdatasheetName"
Const conPropValue = "[None]"
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
Else
If tdf.Properties(conPropName) <> conPropValue Then
tdf.Properties(conPropName) = conPropValue
End If
End If
End If
End If
Next
Set prp = Nothing
Set tdf = Nothing
Set db = Nothing
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
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Reply to group, rather than allenbrowne at mvps dot org.
Brook said:
good day all,
I have a tblinventory that I have been working with, and I just went in
to
the tbl to double check some data and noticed a box with a "+". when I
click
on the box it drops down to information about my invoices, I don't know
who
the "+" got there or how to get rid of it? Can anyone help?
thanks,
Brook