I want to access all text box on a form in a For Each loop. basically i want to clear all text boxs on a button click . this is need to do in a loop.
Printable View
I want to access all text box on a form in a For Each loop. basically i want to clear all text boxs on a button click . this is need to do in a loop.
Use TypeOf operator. This should work:
dim a as control
for each a in me
if Typeof a is Textbox then
a.text = vbNullString
end if
next a
After you type "Typeof a is.." if intellisence is ON then it will prompt with the allowed Types.
RK