ac (1 Viewer)

Little_Man22

Registered User.
Local time
Today, 23:01
Joined
Jun 23, 2001
Messages
118
I have a main form (frmClients) with a button called 'application'. When you push this button it opens a full screen pop-up with various buttons; one of which is 'print application'. When you press this button it saves the record (DoCmd.RunCommand acCmdSaveRecord). However, there is also another button on the form called 'Agent Report'. When you press this button it opens another pop-up called frmAgent which has the same recordsource as the underlying form.

When I make changes to frmAgent and press the exit button the form disappears (so far so good). However, when I attempt to press the button on the main form which saves the record I get a message: "this record has been changed by another user since you started editing it. If you save the record you will overwrite the changes." It gives me three options: (a) save record (b) copy to clipboard (c) drop changes.

Any idea why?

-rjd.
 

pono1

Registered User.
Local time
Today, 15:01
Joined
Jun 23, 2002
Messages
1,186
Roughly speaking, the application is treating each open form that points to the same record as a different user, even when those forms are opened on the same PC, in the same instance of the app.

Here's my best guess as to what I think is happening from Access's point of view:

. A record is opened by a user/form (the record is brought up from a table and put into a buffer).
. The same record is then opened by another user/form; this user/form makes changes and saves the record back to the table and then closes the form.
. The original user/form is still looking at the record -- but the record in the table has changed since they first opened it: it was updated by the other form/user.
. So when you try to save again Access warns that between the time the record was opened in this form and now, someone else (you and your other form) has sneaked in and made changes and updated. And whatever you do here will trump their interim update -- an update that may or may not be reflected on your screen.

Regards,
Tim
 

Little_Man22

Registered User.
Local time
Today, 23:01
Joined
Jun 23, 2001
Messages
118
Ok, I kind of figured that was what was going on...I'm still without a solution though. Any ideas? Do I have to use a different recordsource on the second form or is there an easier way to get around this?

-rjd.
 

pono1

Registered User.
Local time
Today, 15:01
Joined
Jun 23, 2002
Messages
1,186
Sorry to say no quick, easy fixes come to mind at the moment. You could, I suppose, close the forms behind you as you open your pop-up forms and then, when closing your pop-ups, re-open the originals back to the same record (there are a few ways to do this: including using the OpenArgs argument to pass the record number between forms).

Regards,
Tim
 

Users who are viewing this thread

Top Bottom