brucesilvers
06-14-2001, 01:28 PM
I have a "New Member" form that is not bound to a table, but is the basis of an append query that adds records to a table (set up this way to enable various combo boxes which are filtered by queries). Is there a simple way, other than closing and reopening, to clear all fields on the form? Thanks http://www.access-programmers.co.uk/ubb/smile.gif
KevinM
06-15-2001, 12:41 AM
Put a command button on your form and on the OnClick event put....
Dim frm As Form
Dim ctl As Control
Set frm = Me
'Loop through all text boxes and
'Comboboxes on form and set valie to nothing
For Each ctl In frm.Controls
f ctl.ControlType = acTextBox _
Or ctl.ControlType = acComboBox Then
ctl.Value =""
End If
Next ctl
End Sub
HTH
brucesilvers
06-15-2001, 09:55 AM
Thanks http://www.access-programmers.co.uk/ubb/smile.gif I'll give that a try.
brucesilvers
06-20-2001, 12:20 PM
Just wanted to let you know that your code worked perfectly. Thanks Kevin http://www.access-programmers.co.uk/ubb/smile.gif