Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / SQL Server / ADP / November 2005

Tip: Looking for answers? Try searching our database.

How to stop users from "unfiltering" a form?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ryan Langton - 31 Oct 2005 23:43 GMT
I have a form which I control the records filtered on using VB.  Some users
are suppose to be able to see one group of records while other users can see
other records, there is criteria set up on Form_Load that checks their login
and shows them what they should see based on security settings.  However, I
just realized that any user can easily remove the filter and see every
record in the database by clicking the menu item "Record -> Remove Filter".
This is not good.  I've unchecked everything in the startup box so I don't
understand why they still have this level of control on the menu.  How do I
stop them from doing this?

Thanks,
Ryan
J. Clay - 01 Nov 2005 01:23 GMT

Rather than using a view or the table as the records source, use a stored
procedure with parameters.  This way, the form is not doing any filtering,
the server is.  This has the added benefit of being much faster, as only the
data that you need is being sent across the network, rather than everything
and then your form filtering it.

HTH.
Jim

> I have a form which I control the records filtered on using VB.  Some
> users are suppose to be able to see one group of records while other users
[quoted text clipped - 8 lines]
> Thanks,
> Ryan
Sylvain Lafontaine - 01 Nov 2005 01:27 GMT
You must create Views or SP that will do the filtering on the SQL-Server.

Signature

Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: http://cerbermail.com/?QugbLEWINF

>I have a form which I control the records filtered on using VB.  Some users
>are suppose to be able to see one group of records while other users can
[quoted text clipped - 8 lines]
> Thanks,
> Ryan
Robert Morley - 01 Nov 2005 01:45 GMT
In addition to the Views & SP's already mentioned, you can also dynamically
create a Select statement with Where clause as your record source.  It's
essentially the same as creating a View, but can give you a bit more control
over the whole process.

In the On Open event, you'd simply have something like this:

   Me.RecordSource = "SELECT * FROM <YourTable> WHERE <whatever your filter
is>"

Hope this helps,
Rob

>I have a form which I control the records filtered on using VB.  Some users
>are suppose to be able to see one group of records while other users can
[quoted text clipped - 8 lines]
> Thanks,
> Ryan
david epsom dot com dot au - 01 Nov 2005 03:07 GMT
You do get the default pop-up menus unless you
specify a different menu for the form.

(david)

>I have a form which I control the records filtered on using VB.  Some users
>are suppose to be able to see one group of records while other users can
[quoted text clipped - 8 lines]
> Thanks,
> Ryan
Ryan Langton - 01 Nov 2005 18:13 GMT
I do have a custom menu displayed, it still shows the menu with
Filter/Remove on it though.

I fixed this problem by setting the Forms "Allow Filter" property to false.
This greys out the menu item for removing a filter but the VB code still
filters the recordsource.  I could move all my VB filtering code to
Views/Stored Procedures but thats going to be a pretty big undertaking.
Perhaps if someday the database gets large enough to warrant the work, I'll
do it.

> You do get the default pop-up menus unless you
> specify a different menu for the form.
[quoted text clipped - 13 lines]
>> Thanks,
>> Ryan
J. Clay - 01 Nov 2005 19:29 GMT

IMHO, the reason to switch to SQL Server and ADP is to utilize views and
stored procedures.  It is important to understand that you have to think
differently when dealing with and ADP vs. MDB.  If you do not change your
approach to match the technology, you will probably loose reliabilty and
speed.

Just my opinion.

Jim

> I do have a custom menu displayed, it still shows the menu with
> Filter/Remove on it though.
[quoted text clipped - 23 lines]
>>> Thanks,
>>> Ryan
Ryan Langton - 01 Nov 2005 20:03 GMT
The application was built from the ground up as SQL w/ADP.  There are dozens
of server-side views, stored procedures, and functions that are used with
the program.  The complexity of this particular query, however, surpassed my
level of knowledge and ability with T-SQL coding.  It was just much easier
in VB.

Ryan

> IMHO, the reason to switch to SQL Server and ADP is to utilize views and
> stored procedures.  It is important to understand that you have to think
[quoted text clipped - 33 lines]
>>>> Thanks,
>>>> Ryan
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.