Tüm TextBox'lar Temizlensin

Drenated

Legend Member
Joined
Nov 23, 2019
Topics
454
Messages
1,853
Solutions
162
Reaction score
1,523
Code:
Sub ClearAllTextBoxes(frmTarget As Form)
For i = 0 To (frmTarget.Controls.Count - 1)
Set ctrlTarget = frmTarget.Controls(i)
'If it's a textbox, clear it
If TypeOf ctrlTarget Is TextBox Then
ctrlTarget.Text = ""
End If
Next i
End Sub

Aşağıdaki kodu da örneğin bir komut butonunun Click olayına yerleştirerek textboxları temizleyebilirsiniz.

ClearAllTextBoxes FormName
 

Top