View Full Version : Clear Fields Button


manners
10-12-2001, 01:18 AM
Can anyone help me to create a "Clear Fields" Button on a form please?

aqif
10-12-2001, 02:40 AM
Write the code like:

Me.Txtbox1=Null
Me.Txtbox2=Null

I believe that u've to clear each field by mentioning the name of every field in the code.

Cheers!
Aqif

SteveA
10-12-2001, 04:33 AM
You could also write code to loop through the controls collection. ie

Dim ctl as control

For each ctl in Me.Controls
If ctl.ControlType = acTextBox then
ctl.Value = Null
end if
Next ctl

Cheers,
SteveA