Private Sub Form_Load() Me.Move -3000, -2500, Me.Width, 15000 For Each temp In Me.Controls If TypeOf temp Is TextBox Then temp.OnChange = "=FilterTable()" ElseIf TypeOf temp Is ComboBox Then temp.AfterUpdate = "=FilterTable()" End If Next End Sub Function FilterTable() MsgBox 1 End Function
在上面的事件绑定中,注意onchange事件和AfterUpdate事件,前者有on,后者没有on