Control Text Box


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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s