Getting an extra record in my datasheet

J

Joe

I am putting together an Access database for the first
time in a long time, and I guess I'm rusty. I have set
the form up to show the previous record's values since
much of the data to be entered will be identical.
However, when I exit the form, and check the worksheet and
table, I have a repeat of the last entry. How can I
prevent that??

Thanks, Joe [20030829]
 
J

John Vinson

I am putting together an Access database for the first
time in a long time, and I guess I'm rusty. I have set
the form up to show the previous record's values since
much of the data to be entered will be identical.

How are you doing this? Copying the values from the previous record
into the Form? If so, you're copying them into the table.
However, when I exit the form, and check the worksheet and
table, I have a repeat of the last entry. How can I
prevent that??

By closing the Form *ONLY* from a command button, and including a line
Me.Undo as part of that code. By default, closing a form writes the
record to disk.
 
V

Van T. Dinh

Without much info., my guess is that on NewRecord, your code assigns values
to these Controls. Since Access Form automatically saves the CurrentRecord,
the NewRecord with values assigned by your code is saved and you ended up
with an extra Record at the end.

You should set the *DefaultValue* of the Controls rather than the Values.

One method is available in the Microsoft KB:

http://support.microsoft.com/?id=210236
 

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