MS Access, forms. problems saving

M

michelle

Hi folks

I'm getting both confused and mad.
Lets say I have 4 records in a table.When I then save a new record in
a form I still have4 recored in the table. The first one dissapears
and the latest is added.

I have a PK which I can see in the form changes, so that is correct.

The code in my save button looks like ths:
RunCommand acCmdSaveRecord
DoCmd.GoToRecord , , acNewRec

or like this, which havs the same result
RunCommand acCmdSaveRecord
DoCmd.GoToRecord , , acNewRec
DoCmd.Close

The next problem is I close a form which has already calculated data in
it whichI don't want to save I just want to close the form, the data
in the form is still saved.
Whhy??
I use this code.

DoCmd.Close

Please, please, please help me someone.
Thanks in advance
/michelle

(e-mail address removed)
 
K

knawtn via AccessMonster.com

Hi Michelle.
The Record Source for your form should be the table (from what you have
described.) Not really sure why one record replaces the other after clicking
the save button, but check the form's "Data Entry" property. For your design,
it should be set to "Yes".

I would then delete the command button (Save) and replace it with a new,
happier button.

By the way, it would be safer to use an append query to add records from a
form to a table, and have the Save button run the append query, appending the
record (which essentially saves it) to the table.

I hope this helps. Feel free to provide more details.
 

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