Blank Record

R

Roger Bell

I have noticed if you enter information into a field and then delete that
information and Exit the Data Base, the next time you open the form you have
blank record.

Is there any way to avoid this, apart from using the blank record for the
next set of data or deleting the blank record? These blank records tend to
build up.

Thanks for any help
 
J

Jeanette Cunningham

Hi Roger,

you could put a cancel button on the form.
You would code it to undo the entry like this:

Private Sub cmdNameOfButton_Click()
If Me.Dirty = True Then
Me.Undo
End If

DoCmd.Close acForm, Me.Name
End Sub


Replace the obvious with your control name.

When you click this button, the form will close without saving that record.
(assuming that you have just one form in Single Form view)


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
R

Roger Bell

Thanks Jeanette,
Tried this, but it deletes the record even if there is some data in the
fields.

Have I gone wrong somewhere?

Thanks for your understanding
 
K

Keith Wilby

Roger Bell said:
I have noticed if you enter information into a field and then delete that
information and Exit the Data Base, the next time you open the form you
have
blank record.

Is there any way to avoid this, apart from using the blank record for the
next set of data or deleting the blank record? These blank records tend
to
build up.

Thanks for any help

I think the way to avoid this is to get into the habit of using the ESC key
to undo unwanted changes instead of the delete key.

Regards,
Keith.
www.keithwilby.com
 
J

John W. Vinson

I have noticed if you enter information into a field and then delete that
information and Exit the Data Base, the next time you open the form you have
blank record.

Well... sure. You're saving the record as specified by the user.
Is there any way to avoid this, apart from using the blank record for the
next set of data or deleting the blank record? These blank records tend to
build up.

Make one or more fields Required in table design.
 

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