Dim tb As WinForm.TextBox = e.Form.Controls("TextBox1") Dim cb1 As WinForm.CheckBox = e.Form.Controls("CheckBox1") If cb1.Checked = True Then If e.KeyCode = Keys.Enter Then Tables("表A").current("第一列") = tb.text e.Form.Controls("Button1").PerformClick() e.Sender.SelectAll e.Cancel = True End If End If