working with a form

K

Karen Skipper

I want to have a button that will save a record (that part I have down pat)
and then clear the fields on the screen but not erase the data from the
table. How do I make the fields blank on the screen?

I posted for help with this some time ago and the response erases the data
from the table.

Karen
 
P

Pavel Romashkin

If your form is bound to the table (or query), erasing the text boxes
will delete data from the table.
All you need to do to clear the form fields is go to a bew record. This
will put default values in (if you have any), but will clear fields that
don't have defaults specified.
If you insist on staying in the same record but clearing the form, make
it unbound and fill in the controls in VBA. This doesn't really keep you
in the same record (because there is no recordset to stay in) but the
result will look identically.

Pavel
 
R

Rick Brandt

Karen Skipper said:
I want to have a button that will save a record (that part I have down pat)
and then clear the fields on the screen but not erase the data from the
table. How do I make the fields blank on the screen?

I posted for help with this some time ago and the response erases the data
from the table.

That would only work for an unbound form. For a bound form all you have to
do is navigate to the new record position.

DoCmd.RunCommand acCmdRecordsGoToNew

That will both save the record you were on and move you to the new record
position with all controls blank and ready to fill out.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top