Best way to stay in one place (1 Viewer)

Chris RR

Registered User.
Local time
Yesterday, 18:01
Joined
Mar 2, 2000
Messages
354
Hello:
Here's something that worked just fine in Access 95, but is giving me problems in 2000.

I have an Access front end to an Oracle database, in a system that manages mailing lists. The user adds people on a form called "Recipient", then presses a button to bring up a subform so the person can be added to various mailing lists. The key on the "Recipient" table is created by Oracle when the record is added.

The problem comes when a new Recipient should be added to a mailing list. The subform comes up, but the main form has moved to a different record. Under 95, the main form stayed on the record that was just added.

The code on the "add to mailing list" button is like this:
If Me.Dirty Then
Me.Dirty = False
End If

stDocName = "List"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Because Oracle assigns the key to the Recipient record as it is added, I can' save the key and reposition myself. And there could be (and are) duplicate names in the Recipient table, so I can't just look them up that way.

Any hints?
 

Pat Hartman

Super Moderator
Staff member
Local time
Yesterday, 19:01
Joined
Feb 19, 2002
Messages
43,346
If you put a Save button on your form so you can force the new record to be saved without moving off of it, you will be able to retrieve the newly assigned identify field by refering to the control that displays it.

The command to save the current record is:

DoCmd.RunCommand acCmdSaveRecord
 

Users who are viewing this thread

Top Bottom