0

我有一个创建表单的过程,然后在子表单控件中使用它。

我通过docmd.echo但侧边栏字段列表显示并后退来抑制视觉创建。

有没有办法抑制字段列表侧边栏?

4

1 回答 1

0

这将在您重新打开数据库时适用。MS Accesss 2010 有六种用户可以使用的方法。这些可以从“选项”菜单中手动更改。

Sub SetStartUp()
    SetProp "StartupShowDBWindow", True, dbBoolean
    SetProp "AllowFullMenus", True, dbBoolean
End Sub

Sub SetProp(PropName As String, PropVal As Variant, Optional PropType = dbText)
Dim db As Object
Dim prp As Object
Dim strTitle As String

Const PROPERTY_NOT_FOUND As Integer = 3270

On Error GoTo ErrorHandler

   Set db = CurrentDb

   ' Try to set the property. If it fails, the property does not exist.
   db.Properties(PropName) = PropVal

ExitLine:
   db.Close
   Set db = Nothing
   Set prp = Nothing
   Exit Sub

ErrorHandler:
   If Err.Number = PROPERTY_NOT_FOUND Then
      ' Create the new property.
      Set prp = db.CreateProperty(PropName, PropType, PropVal)
      db.Properties.Append prp
      Resume Next
   Else
      Resume ExitLine
   End If

End Sub
于 2012-08-17T16:51:21.610 回答