Object locked on closing form

G

Guest

Hi

My app has a "splash" screen where user inputs criteria for a report
(displayed in a form). One of the criteria determines which report is run

"Run report" button results in opening a form which has Tab control.
The Tab control contains three pages.

Page one has a subform displaying data from a query (query parameters are
provide by the controls of the "splash" screen).
Page two has a chart object with row source type of table/query and row
source a "select" expression using the same query which gives the results for
page one
Page three has a second chart object as page two but with different data
selected.

The problem

1. If user closes the form without selecting the page tabs on which the
graphs are located they receive an Access message dialog "The object is
locked, so any changes you make will be discarded when the form is closed.
Click Save As/Export on the file menu and save the object under a different
name." They receive this message twice

2. If the user closes the form after selecting only one of the page tabs for
a graph they receive the above message once

3. If the user closes the form having selected both graph tabs they do not
receive the message at all

I'm guessing it has something to do with Access believing the embedded graph
object has changed and therefore so too has the form. I've tried
"docmd.setwarnings false" without any joy. I've tried to set the locked
property of the embedded graph to false but I can't find the correct syntax
(if indeed it exits)

Can anyone offer a workable solution

Regards

Michael Bond
 
G

Guest

I am not sure this will help, but it is worth a try. Use the acSaveNo option
when you close the form:
DoCmd.Close acForm, Me, acSaveNo
 
G

Guest

Thanks. I had to change the Me keyword to the actual name of the form. Worked
perfectly

Regards

Michael Bond
 
D

Douglas J Steele

To avoid having to hard-code the formname, you can use

DoCmd.Close acForm, Me.Name, acSaveNo
 

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