possible to hide records on table from form, report display?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have some records on one table that I don't want users to see at this time
in forms or reports. Can I restrict access to them without removing them from
the table? I don't want to delete these records from the table. can anyone
help?
 
Sure, just filter them out in the query upon which your forms and reports
are based. If there is no way to distinguish the fields, then add one. Add
a field to your table called "Hidden" or something and then exclude the
records where the "hidden" checkbox is checked.
 
Hi.

If you are restricted to using Jet, then the best way is to implement
User-Level security and remove permission to view the table from the regular
users. Then create queries for these users that omit these special records
and apply the "Run With Owner's Permissions" (RWOP) Property to the query.
Base your forms and reports these queries.

If you can use a client/server for the back end, then have the DBA restrict
these users from accessing this table and create views that avoid displaying
the special records.

The query that avoids the displaying special records would use the following
syntax:

SELECT *
FROM MyTable
WHERE (Confidential = FALSE);

.. . . where MyTable is the name of the table and Confidential is the name of
the field (Boolean data type) added to the table to distinguish the "special"
records.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips.

(Please remove ZERO_SPAM from my reply E-mail address so that a message will
be forwarded to me.)
- - -
If my answer has helped you, please sign in and answer yes to the question
"Did this post answer your question?" at the bottom of the message, which
adds your question and the answers to the database of answers. Remember that
questions answered the quickest are often from those who have a history of
rewarding the contributors who have taken the time to answer questions
correctly.
 
If you base the forms/reports on queries (with owner access) you obviously
need to add to your where clause something that links the rows to the logged
in user.

Approaches include a table of usernames to access levels, duplication of
access security (users and groups) so that the rows returned depend upon
membership of various groups.

---------------

SELECT <your columns here>
FROM tblYourTable
WHERE <your where clause here>
AND tblYourTable.AccessLevel <=
SELECT tblUserName.AccessLevel
FROM tblUserName
WHERE tblUserName.UserName = CurrentUser()

---------------

SELECT <your columns here>
FROM tblYourTable
WHERE <your where clause here>
AND tblYourTable.AccessLevel <= VBAFunctionReturningAccessLevel()

---------------

And so on, in short some value on the rows must be validated against the
user.

Let the hard part commence - John
 
Rick B said:
Sure, just filter them out in the query upon which your forms and reports
are based. If there is no way to distinguish the fields, then add one. Add
a field to your table called "Hidden" or something and then exclude the
records where the "hidden" checkbox is checked.

Rick, I don't know how to use a query in a form. I thought that queries
could only be applied to reports. Do I need to code user privileges to allow
disclosure of the records in question. I only want to filter the records from
the table that the form is based on, only the records will be filtered until
I deem them "unhidden" and not just until the form is closed for one session.
I want this state to remain effective until I choose. What you are proposing
does sound rather simple and effective, I guess that I don't quite follow you
completely. Please elaborate on your advice.
Thanks
 
Hi, this reply may have been given out of turn, so I'll repost it:
to Rick B,
I don't know how to use a query in a form. I thought that queries
could only be applied to reports. Do I need to code user privileges to allow
disclosure of the records in question. I only want to filter the records from
the table that the form is based on, only the records will be filtered until
I deem them "unhidden" and not just until the form is closed for one session.
I want this state to remain effective until I choose. What you are proposing
does sound rather simple and effective, I guess that I don't quite follow you
completely. Please elaborate on your advice.
Thanks
 
Thanks everyone for helping the light to go on in my brain. It's simple to
make a query the record source for a form, and I now know that. This is
another choice fact to place in my medicine bag.
This community is such a valuable resource.
Cheers!
 
Back
Top