例如:private sub form_load() text2.setfocusend sub当然,窗体上放了两个text控件,分别为text1和text2
setfocus应该在load完成之后进行,不能在load过程内
On Error GoTo MyErrorHandler
然后在底部放
On Error Goto 0
Exit Sub
MyErrorHandler:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") at line " & Erl