dim ctl as control
for each ctl in controls
if typename(ctl)="textbox" or typename(ctl)="conmand" then
......你的程序......
end if
next ctl
for each ctl in controls
if typename(ctl)="textbox" or typename(ctl)="conmand" then
......你的程序......
end if
next ctl
for each con in form*(窗体名称)
if typeoff con is textbox or typeoff con is command then
...........
...........
endif
next