Turning off warning message when form closes

G

Guest

Access 2000

I have a form which displays sub forms (Query results) and a chart. When
closing the form it always pops up with a warning message saying

"The object is locked so any changes you make will be discarded when the
form is closed
Cick Save As/Export on the file menu and save the object under another name"

The you click ok to continue

I never make changes to data in this form and it always displays this. I
have tried to turn it off using a set warnings macro ("off" on open) yet that
doesn't work.

I'm missing something really obvious aren't i...
 
K

Kc-Mass

Just looking at syntax - Try:
DoCmd.SetWarnings FalseI don't believe it accepts "Off""Engels"
 
G

Guest

I didn't use "off" as syntax i created a Macro that ran a Set warnings
action to turn all the warnings off and called it "on open" on the form. But
the warning seems to happen regardless of whether set warnings is on or off
as i have manually run the macro then closed the form it still does it.

It only seems to do it when one of the sub forms are currently selected and
not when i tab to other buttons????
 
V

Van T. Dinh

It sounds to me that the warning has nothing to do with the data. My guess
is that the *Design* of the Form has been changed during the time the Form
was opened and when you close it, Access picks up that the design of the
Form is protected (i.e. cannot be changed) and gives you the option to save
the changed design of the Form as a new Form.

What changes the design of your Form? I can't see your database but I guess
there may be code that does this ...
 
S

Steve Schapel

Engels,

I am not familiar with this particular error message. But it would
appear that there is some change being made, perhaps via a macro or
code, to the *design* of the form or subform, as distinct from any
change to the *data*. The SetWarnings action is not applicable in this
case.

Apart from that, sorry I can't be more precise about why this is happening.

You may be able to simply trap the error in the applicable VBA
procedure, and bypass the error message that way.
 
G

Guest

Well i have seemingly bypased the problem for the most part by removing the
subforms from the tab index and fir some strange reason that seems to work.

thanks for the help all
 

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