Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Switching form filters on and off

Status
Not open for further replies.

SpandexBobcat

Technical User
Joined
Jul 31, 2003
Messages
332
Location
GB
Hi there,

I have a database that for low level users filters the data so that they can only see certain records, where as top level users do not have this enabled.
The result being that the bottom end users cannot have the right click filtering options as this messes with the filtering I have imposed. To get round this I have been using two front ends, one with the filters allowed, the otrher without...
Is there a simple line of code to tell access to switch off or on these filters? It would be based on UserType...

Thanks in advance,

SpandexBobcat
 
1. Create two seperate login accounts for low-level and high-level user's. Search for threads on creating Access security accounts to do this.
2. Write some VBA code that determines which log-in was used to access the database, and then use this to decide how to handle the form.

'Code works for A2YK and above
select case Application.CurrentUser
case "highlevel-username"
'do action here for highlevel user
case "lowlevel-username"
'do action here for lowlevel user
end select

I don't know how you've implemented the filtering on/off procedure, but you may be better off creating a continous form based upon the table/query, and then adding your own filter text box/command buttons in the form header. Each form has Filter and FilterOn properties. Check out other threads or the helpful Access VBA help for further info on these properties.

 
Thanks for the responce.
I know about Select Case and intended on using it.

I have been implementing the filter on/off by setting 'Filters allowed' to yes or no on the desired forms... I need to be able to do that in code, using the Case method. Do I have to create my own filter or can I just turn the default one on or off...?
 
Have you looked at the FilterOn property?

Me.FilterOn = True

OR

Me.FilterOn = False

-Gary
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top