Problems saving/inserting records

BradyL

New member
Local time
Today, 21:09
Joined
Jun 5, 2002
Messages
9
I am having a strange problem and need help...

When on my main form after I have filled out all of the necesary fields on a new record I click the save record button. The form immediately switches to the record that was previously the last record before going to a blank record. (ie with 10 original records, an 11th is added. the original 10th record is now the 11th and the new record is now the 5th). This also happens when I fill out all the fields and then click on a subform. The record saves properly for future viewing, but I need the new record to stay on the screen inorder to add more data to the subform.

The form is sorted by a key where new records are incremently assigned values.

Any help would be appreciated.

Thanks!

Brady
 
Sounds like it reapplies the filter when you save it. I may not understand what you're doing exactly, but I can give it a shot:

You probably already know this, but since you know what the record number is, you can probably write some code into your save button that sends you to back to that record number after it's been saved.

Or alternatively, get rid of the save button altogether and let Access save the records when you're done with the subform?
 
STILL NEED HELP! (thanks)

Let me explain my self better. (I can get rid of the save button, but the problem still lies within the subform).

After filling out all neccessary fields in the main form, and then clicking on the subform, the active record switches to a previously entered record. This switch is happening between the "before update" event and the "after update" event.

There are no filters on (or allowed).

So please help if you know what is going on. Thanks.

Brady
 
Check the code in your save button. The CORRECT way to save a record is:

DoCmd.RunCommand acCmdSaveRecord

If you are using any other method such as Me.Refresh or Me.Requery, change your code.
 

Users who are viewing this thread

Back
Top Bottom