Control Text Box

May 9, 2008

Option Explicit

Private Sub cmdSetTextbox_Click()

Dim ctl As Control

‘buat sebuah variable di control object
Dim textControl As TextBox

For Each ctl In Me.Controls

If TypeOf ctl Is TextBox Then

ctl.Text = “”

End If

Next

End Sub

Private Sub cmdCheck_Click()

Dim ctl As Control

For Each ctl In Me.Controls

If TypeOf ctl Is CheckBox Then

ctl.Value = 1

End If

Next

End Sub