473,503 Members | 5,593 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I Stop Users Saving Over a Form Design

37 New Member
** Mod ** This post was split away from Access 2003/ VBA form filter problem as it's a new question.

NeoPa, I've come up against the same problem again, though this time I think a user was using CTL S each time they viewed a filtered form to "save the result" and thus created a problem it took some time to find. (the form appeared blank on several occasions when there was data to show because of the filter)

I would really like to find a way to clear a form filter in VBA. Toggling "Me.FilterOn" does not change the filter saved with the form, the only way I know of to do this is clearing manually the filter and saving the form again. This clearly requires me to go to site..

Does anyone know of a way to remove the filter in VBA?

Is there a better way to call a form with a subset of data?
Mar 10 '12 #1
5 2049
NeoPa
32,557 Recognized Expert Moderator MVP
The first, and most obvious, answer is to release an MDE or ACCDE version for your users to use. Providing them with the ability to save changes to your database design is not good thinking.

Alternatively though, you could try putting some code in the Form_Close() event procedure that clears the .Filter property and saves the form. That way it would always be virgin next time it's used.
Mar 10 '12 #2
ADezii
8,834 Recognized Expert Expert
Expand|Select|Wrap|Line Numbers
  1. DoCmd.RunCommand acCmdRemoveFilterSort
Mar 10 '12 #3
NeoPa
32,557 Recognized Expert Moderator MVP
That's certainly one way to remove the filter before saving the form ADezii, but it may be easier simply to clear the properties :
Expand|Select|Wrap|Line Numbers
  1. With Me
  2.     .Filter = Null
  3.     .FilterOn = No
  4. End With
Mar 10 '12 #4
ADezii
8,834 Recognized Expert Expert
  1. DoCmd.RunCommand acCmdRemoveFilterSort will Reset the FilterOn Property to False.
  2. Won't Me.Filter = Null generate an Error, since it must be a String Value?
Mar 10 '12 #5
NeoPa
32,557 Recognized Expert Moderator MVP
Quite right ADezii. I should have suggested :
Expand|Select|Wrap|Line Numbers
  1. With Me
  2.     .Filter = ""
  3.     .FilterOn = False
  4. End With
As for the use of RunCommand, it may do part of the job, quite adequately, but personally I prefer to reset the .Filter property as well as the .FilterOn one. There's less likelihood of anyone getting confused by seeing a filter string there which isn't filtering.
Mar 11 '12 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
5589
by: John | last post by:
(access 2002) Anyone have any suggestions as to what may be causing access to not save form changes after I "tell" it to, exit database, then re-open later to discover the changes had not been...
2
3535
by: Pete | last post by:
Before I get started with the question, does anyone have a (single) good book recommendation for database design? Not an Access-specific book, but something geared toward helping me figure out...
1
1723
by: Bob Darlington | last post by:
Is there any shortcut key combination to switch focus between the property sheet and form design without using the mouse. -- Bob Darlington Brisbane
0
2681
by: misscrf | last post by:
I am currently working on a database, in 3rd normal form, which is for candidates who apply for a job with the law firm that I workd for. My issue is with good form design. I have a main...
1
1490
by: ANSWER | last post by:
Hi, I want to Stop users to import my tables and queries into their database. Is there some VB code or is only solution to make security workgroup permission. If this is the only solution...
1
1390
by: WJ | last post by:
I have a need to hire Web Designers who do nothing but design plain web forms in ASP.NET format. Unfortunately, most of these folks do not know how to use VS.Net 2003 to design Asp.Net forms....
4
1943
by: yanjie.ma | last post by:
Hi, I've got a two part question on table and form design (sorry for the length but it takes a bit to explain). Our sales department uses a look-up table to help the them select the best...
2
4199
by: RajaKannan | last post by:
Hi All, I have a form in which i have few mandatory fields. Wheneve the user tries to save, i check for these fields and alert them, if thet are empty. I have a CLOSE button in my form and...
18
24929
by: Diogenes | last post by:
Hi All; I, like others, have been frustrated with designing forms that look and flow the same in both IE and Firefox. They simply did not scale the same. I have discovered, to my chagrin,...
1
1364
TheSmileyCoder
by: TheSmileyCoder | last post by:
Is there any way in which to catch the saving of design changes to a form? Just to be perfectly clear, I am not talking about saving a record, but I was wondering if it would be possible on a...
0
7063
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7258
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7313
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7441
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5558
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4663
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3156
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1489
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
720
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.