What is this linked table?
Is it an Access database?
Access 97 or earlier?
The table must have the SubDatasheet property, which was first introduced in
A2000. If the back end is an A97 table, you could create a property of type
dbText, named SubdatasheetName on the table. The front end linked table
interface should then recognise and respect the setting.
Open the A97 back end.
Paste in the code below.
Make sure it compiles.
Open the Immediate window (Ctrl+G)
Enter a line like this:
? SetPropertyDAO(CurrentDb().TableDefs("MyTable"), "SubdatasheetName",
dbText, "[Auto]")
Function SetPropertyDAO(obj As Object, strPropertyName As String, _
intType As Integer, varValue As Variant, Optional strErrMsg As String) As
Boolean
On Error GoTo ErrHandler
'Purpose: Set a property for an object, creating if necessary.
'Arguments: obj = the object whose property should be set.
' strPropertyName = the name of the property to set.
' intType = the type of property (needed for creating)
' varValue = the value to set this property to.
' strErrMsg = string to append any error message to.
If HasProperty(obj, strPropertyName) Then
obj.Properties(strPropertyName) = varValue
Else
obj.Properties.Append obj.CreateProperty(strPropertyName, intType,
varValue)
End If
SetPropertyDAO = True
ExitHandler:
Exit Function
ErrHandler:
strErrMsg = strErrMsg & obj.Name & "." & strPropertyName & _
" not set to " & varValue & ". Error " & Err.Number & " - " & _
Err.Description & vbCrLf
Resume ExitHandler
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