我正在尝试将按钮动态设置为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