Results 1 to 11 of 11
  1. #1
    Marko_13 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2016
    Posts
    6

    A form that does not allow to browse records

    Hi there


    I got a trouble finding a solution for my problem. The case is:
    - I want to design a database for my workers so that they can enter their KPI's there
    - I'd like to see those changes in real time (not only in the end of a month) in order to monitor what's going on in my team
    - None of them should see their collegues's KPI's. Means, that they cannot see the table - the only person who sees the table should be me ;]

    I figured out that I can divide my database into 2: inner and outer database. The inner database will be the actual table with data while the outer one will be the data-entry form.
    The thing is, even if my employees have the access to the form only - they can still navigate through the records. I'd like to disable that. I do not know how.
    Is there a way to do it?
    Any better solutions?

  2. #2
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    rather than your form recordsource being a table, use a query but you will need to backup a bit

    Each user will need to login (or you can use the windows login name) and your table needs to have a user field populated with the relevant userid

    your query can then have criteria to limit the records to those of the logged in user

  3. #3
    Marko_13 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2016
    Posts
    6
    Quote Originally Posted by Ajax View Post
    rather than your form recordsource being a table, use a query but you will need to backup a bit
    I would appreciate if you explain this concept a bit more in detail. I cannot imagine how to do it

  4. #4
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    at the moment you probably have a form recordsource like 'myTable'

    instead you have a query

    SELECT * FROM myTable WHERE username=loginname

  5. #5
    Marko_13 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2016
    Posts
    6
    Yes, but I'm not sure whether how it possible to add records to a database by using a form which is binded to a query and not the actual database (table).

    Does this article describe your advice for me? https://support.office.com/en-us/article/Use-a-query-as-the-record-source-for-a-form-or-report-e54251f3-57ca-4a7d-8e77-e498966cd41b

  6. #6
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    Yes - the recordsource can either refer an existing query (per your link) or you can put the sql to the query in the recordsource in the form - which is my personal preferred option since (with criteria) it reduces traffic so is faster.

    but I'm not sure whether how it possible to add records to a database by using a form which is binded to a query
    providing the query is updateable yes. queries which are not updateable include action queries (append/update etc), crosstabs and complex queries - the rule is one form, one table - the query aspect is to filter the records in some way - in your case, by user

  7. #7
    Marko_13 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2016
    Posts
    6
    Quote Originally Posted by Ajax View Post
    your query can then have criteria to limit the records to those of the logged in user
    OK! I'm starting to get it. Now, I don't know how to make access recognize the user and automatically use this information as query criteria...

  8. #8
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    you'll need to use vba

    investigate Environ("username") - this will return the windows login name for the user currently logged in

    you'll need a public function in a module

    Code:
    Function GetUsername() as String
    GetUsername=Environ("username")
    end function
    then your query will be something like

    SELECT * FROM myTable WHERE username=getusername()

    so you will have in your table a field called username and as new records are created you will need to populate it - to do this put this code in the beforeupdate event of the form

    Code:
    username=environ("username")

  9. #9
    Marko_13 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2016
    Posts
    6
    Wow! Sounds awesome. Will try to try it.But let's look towards the future. Even if everything works fine, I'm wondering how the hell will I be able to actually see the whole query? I mean, I have a username as well so..I assume that if open the query I will see...nothing? Will I need to alter the code everytime I need to monitor my employees work?I tried a way around: I opened a blank access project and tried to connect (not import) the query to it (so that I would have my own file, password protected). But I sadly discovered that one can connect tables but not queries.

  10. #10
    Marko_13 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2016
    Posts
    6
    Quote Originally Posted by Marko_13 View Post
    I tried a way around: I opened a blank access project and tried to connect (not import) the query to it (so that I would have my own file, password protected). But I sadly discovered that one can connect tables but not queries.
    Well actually I tried again and this works just fine. But this solution doesn't seem like the best one: now any smartass can connect to the query and see all the table data :/

  11. #11
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    recommend you find some online lessons to understand how it all works.

    Once developed, users should only have access to forms and reports, everything else hidden away. Protecting data is important but your strategy has to be built around who and why - any system can be broken by someone with the right skillsets and determination.

    Developing a secure and effective db is not an easy task, if you are the business owner you should consider employing a professional to develop your database, they will build it in a fraction of the time it will take your - and whilst you are building it, you are neglecting your business

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Browse and Open Folder Based on Matching Form Field
    By Tomfernandez1 in forum Access
    Replies: 11
    Last Post: 02-26-2013, 01:04 PM
  2. Replies: 4
    Last Post: 09-18-2012, 11:30 PM
  3. Replies: 1
    Last Post: 06-21-2012, 07:58 PM
  4. Browse to external file while in a form
    By michaeljohnh in forum Import/Export Data
    Replies: 9
    Last Post: 09-22-2010, 09:33 AM
  5. Browse for file
    By ccpine@comcast.net in forum Database Design
    Replies: 0
    Last Post: 08-24-2008, 10:12 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums