Clearing fields on a Form

  • Thread starter Thread starter MichaelR
  • Start date Start date
M

MichaelR

The users of my database would like a 'Clear Fields'
button. This button would automatically clear all the
current records fields on the form (which is for
edit/entry of data for a single table). Some of these
fields are mandatory. When I try to set each one to Null
or an empty string, it gives me an error the field cannot
be Null.

This is simply a cosmetic issue since they can simply tab
through the fields, typing over what is already there
with the new data. However, they want blank fields so
they don't get confused. I can't simply delete the
record and start a new one because the Primary Key is an
Autonumber field and is already related to either records
in other tables using that Key.

Any ideas?
 
Hi!
in the event-code for the comman button you created add
this line:

Me.undo will reset all the control of the form deleting
the entries

or
controlname.undo will reset the value entered on the last
control

Give it a try.
 
probably you have setted for some fields the propertiy
required=yes (primary key for sure).
if you have only one fields with this setting try to sett
controlname.value="" or Null
for any other control and
controlname.setfocus
controlname.text="" for the control with the required
property="yes"
let me know
 
Back
Top