English 中文(简体)
管理系统存取VBA, 以便能够/可拆卸一个文本箱
原标题:MS Access VBA to enable / disable a text box

我可以查阅下文的《万国邮局守则》,以便提供/可分发的文字箱。

在实施该守则时,货箱仍然残废。

我没有其他财产吗?

Private Sub EnableTonnes()

  Dim sCode As String
  sCode ="xx"


    set default values for tonnes enabled and locked properties
  Tonnes.enabled = False
  Tonnes.Locked = True

 If sCode = "xx" Then
      enable tonnes field
    Tonnes.enabled = True
    Tonnes.Locked = False
  End If

End Sub
问题回答

你的法典看着ok。 文本Box的特性是以形式设计的方式确定的,只能以形式设计方式永久改变。 你做了一些精细的编码,以设计方式打开表格,改变财产,然后节省形式......或人工操作。 你们总是能够使用你的法典来控制这些财产。

Option Compare Database
Option Explicit

Private Sub cmdGo_Click()

    Dim sCode As String
    sCode = "xx"

      set default values for tonnes enabled and locked properties
    txtTonnes.Enabled = False
    txtTonnes.Locked = True

    If sCode = "xx" Then
          enable tonnes field
        txtTonnes.Enabled = True
        txtTonnes.Locked = False
    End If

    MsgBox txtTonnes.Name & " Enabled status is " & txtTonnes.Enabled
    MsgBox txtTonnes.Name & " Locked status is " & txtTonnes.Locked

End Sub

Private Sub Form_Load()
    MsgBox txtTonnes.Name & " Enabled status is " & txtTonnes.Enabled
    MsgBox txtTonnes.Name & " Locked status is " & txtTonnes.Locked
End Sub




相关问题
Handling no results for docmd.applyfilter

I have an Access app where I use search functionality. I have a TextBox and a Search Button on the form, and it does a wildcard search of whatever the user enters in the TextBox, and displays the ...

Outlook 2007 CommandBarControl.Execute won t work

I recently switched to Outlook 2007 and noticed that my VBA-macros won t work. I use the following code to open a new appointment-item (and fill it automatically). It worked perfect in Outlook 2003, ...

Connecting to Oracle 10g with ODBC from Excel VBA

The following code works. the connection opens fine but recordset.recordCount always returns -1 when there is data in the table. ANd If I try to call any methods/properties on recordset it crashes ...

MS Access: list macro from VBA

I have to deal with a few macros (not VBA) in an inherited Access application. In order to document them, I would like to print or list the actions in those macros, but I am very dissatisfied by ...

热门标签