动态设置按钮可见

时间:2014-06-12 14:46:51

标签: forms vba access-vba

我正在尝试将按钮动态设置为true,但我得到一个Object Required错误标志。我该怎么做呢?

Private Sub addRow(i)
  'Sets next row visible
  Create_Report.Controls("cmbNum" & CStr(i)).Visible = True
  Create_Report.Controls("cmbMetric" & CStr(i)).Visible = True
  Create_Report.Controls("buttonAdd" & CStr(i)).Visible = True
  Create_Report.Controls("buttonCancel" & CStr(i)).Visible = True

  'Removes buttons from previous row
  Create_Report.Controls("buttonAdd" & CStr(i - 1)).Visible = False
  Create_Report.Controls("buttonCancel" & CStr(i - 1)).Visible = False
End Sub


Private Sub buttonAdd0_Click()
  addRow (1)
End Sub

0 个答案:

没有答案