Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Prompted to save changes after applying a filter

Posted on 2004-09-14
10
Medium Priority
?
321 Views
Last Modified: 2008-03-06
I have an Access Project connected to a SQL Server backend. There are a number of forms which are used to view the data and the "Filter by Form" button is used often to restrict the records displayed.

Whenever the users apply a filter and then close the form, they are asked whether they want to save their changes to the form. The only change they have made is to apply a temporary filter which they never want to save. In any case, the project is read-only so they cannot actually save the change anyway.

Is there any way to stop them being prompted if their only change is to apply a filter? I have tried intercepting the close event in order to undo the filter, but the prompt seems to come up before any of the events fire.
0
Comment
Question by:ChrisThornton
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 14

Expert Comment

by:bluelizard
ID: 12053105
my solution to this problem was a close button with the code

  DoCmd.Quit acQuitSaveNone

behind it (but make sure you don't use that button after actually modifying the database...)


--bluelizard
0
 
LVL 2

Author Comment

by:ChrisThornton
ID: 12053179
Unfortunately the users have been using this system for some time as an mde using DAO to connect to SQL Server, so they're pretty used to closing forms by using the little cross in the corner of the form or just closing the whole app. Incidentally, the mde incarnation of the system doesn't exhibit this behaviour (any idea why there's a difference?).
0
 
LVL 9

Expert Comment

by:solution46
ID: 12053481
mde files are locked and Access knows that the design of a form cannot be changed - there is probably a more accurate technical description out there but this is close enough.

Why not just make an mde of your new version?

s46.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Author Comment

by:ChrisThornton
ID: 12053568
I tried that, well an ADE which is the Access Project equivalent, but I still get the prompt. It is a little different though, in that it asks whether I want to save changes to the view which the form is based on rather than the form itself. Is the filter in the project trying to save as a "where" clause in the underlying object rather than as a normal Access filter?
0
 
LVL 2

Author Comment

by:ChrisThornton
ID: 12053770
Something else I just found:

It only prompts to save changes after using the "Filter by Form" button. Using "Filter by Selection" or the "Filter For" on the right-click pop-up menu doesn't cause the prompt on closing the form.
0
 
LVL 41

Expert Comment

by:shanesuebsahakarn
ID: 12054272
I haven't tried this, but have you tried clearing the filter in the form's OnClose or Unload event?
0
 
LVL 2

Author Comment

by:ChrisThornton
ID: 12054394
That was my first thought too, but the prompt comes up before these events fire.
0
 
LVL 11

Accepted Solution

by:
miqrogroove earned 2000 total points
ID: 12089562
ChrisThornton, this is actually a simple configuration problem.

Every Access form has a property called "Allow Design Changes".  It is hidden at the very bottom of the "Other" tab in the properties for the form.  The default value for this property is "All Views"  Regardless of whether the user actually has the ability to save the form, you must set this proptery to "Design View Only".  If you do not, then the tiniest little change to the form (even filters) will cause a save prompt.

Enjoy,
-- Miqro
0
 
LVL 2

Author Comment

by:ChrisThornton
ID: 12100528
Thanks Miqro.

I was really hoping it was going to be something simple - but it so seldom is.

Back to the Access for Beginners course for me!

Chris.
0
 
LVL 11

Expert Comment

by:miqrogroove
ID: 12103414
I think of Access as a million simple pieces put together.  It is often overwhealming, but reliably so.

Glad to help,
-- Miqro
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question