473,406 Members | 2,387 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

How do I Stop Users Saving Over a Form Design

** 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 2047
NeoPa
32,556 Expert Mod 16PB
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 Expert 8TB
Expand|Select|Wrap|Line Numbers
  1. DoCmd.RunCommand acCmdRemoveFilterSort
Mar 10 '12 #3
NeoPa
32,556 Expert Mod 16PB
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 Expert 8TB
  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,556 Expert Mod 16PB
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
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
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
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
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
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
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
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
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
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
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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
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
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...

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.