Clear a Form Field after an Error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to format a Form field during error checking. If there is either
a system error or an error supplied by my validation, can I force the field
to be cleared of all previously typed data and have the user start from blank
(or a template) in that field once again? (e.g. they accidentally type a
character in a numeric field, or they mis-key in a date field.)

Thanks!
Leslie
 
There are a couple of options, depending on what you want to do.

1) Me.ControlName.Undo
2) Me.ControlName = Null

The Undo will undo what they just typed in. If there was previously a value
in that control, the control will return to that value.

Setting the control to Null, will clear the control. This will work for a
control that has a single value, not for a multiselect listbox.
 
Thanks Wayne,

This gives me something to work with. I will give this a try.

Cheers,
Leslie
 
Back
Top