我想根据模块中的输入框值更改报表中文本框的值。
Public Sub ChangeTextBox()
Dim UserText As String
UserText = InputBox("Enter The Value")
'The part I don't understand is how to branch out to the text box name
'I know you have to do something like Form!Formname.textbox name but I'm so confused
'How do I link it to the textbox from within module?
由于
答案 0 :(得分:0)
尝试以下代码。
formname是表单名称 txtName是文本框名称
Public Sub ChangeTextBox()
Dim UserText As String
UserText = InputBox("Enter The Value")
If UserText <> "" Then
ActiveCell.Value = s
formname.txtName = "dfd" ' where txtName is textbox name
End If
End Sub
对象浏览器视图