i tried this code,but it is throwing error.
Private Sub ClearText
Dim ctl As Control
' Clear all the TextBoxes on the form.
For Each ctl In Controls
If TypeOf ctl Is TextArea Then ctl.Text = ""
Next
End Sub
Can anyone suggest some logic, thanks
I think you need to cast ctl to type TextArea before you can set property Text
I think this will work
You can also use DirectCast, it might provide somewhat better performance than CType.