Problem with popup form on a single record

L

Lambi000

I have a record that has a form for a user to enter information into. If the
user needs to add additional information, a popup screen (popup and modal)
comes up for them to add additional information. Both forms service one
record. Occasionally, and I can't seem to define it exactly, I get an error
message saying that another user (I'm the only user) is trying to update the
record and I have three choices: Save the information, write it to the
clipboard or dump the information. The last time I saved it, I corrupted the
entire database and had to start all over again.

The only thing that I think may be causing this is a routine that changes
the date if a certain button is pushed. Does changing the date cause both
forms to attempt to update to the new date? If so, what can I do to change
the underlying data without having both of them attempt to update at the same
time?

This usually, but not always, happens after the popup has closed and the
original form is doing a close form. I must have tried a hundred times
(probably more) to duplicate this and get a consistent pattern.
 
J

Jeanette Cunningham

Hi,
the error is access' way of telling you that you have 2 open forms that edit
data from the same table.
This scenario is a problem for access, it doesn't know which data to save,
and thus you see the error message.
If you open the popup form with an acDialog argument, the main form will be
disabled until the popup is closed. This will stop the error message.

Code it like this:
DoCmd.OpenForm "YourFormName", , , , , acDialog

When you use the acDialog argument to open a form, its popup and modal are
temporarily set to true, without any need to set these properties to true on
the forn's property sheet.

Jeanette Cunningham
 
L

Lambi000

Looks like that did it. It makes sense that if you can go back and forth
between the two screens there would be a problem. Thanks, Jeannette.
 

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