Error Message While Exiting Form

B

BW

I have a form that contains a subform. Through code at times I am using
the orderby functionality of the subform. Everything works fine until I
exit the main form and then I get the error message " The setting you
entered isn't valid for this property". I get this message 4 times. If I
don't execute the code orderby apply the orderby and orderbyon properties I
don't receive this message. I have tried turning orderbyon = false before
existing the form but I still get the message. This is utilizing Access
2003. Any ideas?

Thanks
BW
 
A

Arvin Meyer MVP

You might try explicitly setting the Order By back to an empty string and
saving the form. I'd try it in the unload event:

Me.OrderBy = ""
DoCmd.RunCommand acCmdSave
 
B

BW

I don't know if this helps or not but the form disappears before this error
is presented. I added a breakpoint on the unload event and it is executing
before the error appears.


BW
 
B

BW

I found a work around to this. I tried utilizing with every event that I
could when closing the form and subform. The only way to stop this from
happening was to set the subforms source objecty to "" before closing the
form. I really wish I knew why it was throwing this error but this work
around seems to handle the error message.

BW
 
A

Arvin Meyer MVP

BW said:
I really wish I knew why it was throwing this error but this work around
seems to handle the error message.

There is often a persistence to saving a filter or sort. By resetting the
OrderBy property you are defeating the persistence. I don't know why, but
Microsoft assumes that you will want to reapply the same filters always. If
you have lookup fields (as opposed to using queries for lookups) the errors
you are finding are intensified.
 

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