Results 1 to 2 of 2
  1. #1
    nick.h is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Nov 2011
    Posts
    22

    Filter a control on load

    I have an unbound combo box that pulls data from another field, and I would like to filter it so that some records do not show up for some users.

    How would I write the code to filter the results?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    The records must have a field you can use to filter with, such as EnterBy field that has user ID. Then you need to get the user ID when they open the project. You can have them enter ID on a login form or grab the network username with: VBA.Environ("USERNAME"). Access will not recognize the Environ() function but VBA will.

    Search this forum on keyword Environ and poster June7 to view other threads I have responded to on this topic. Here are two:
    https://www.accessforums.net/securit...ers-17894.html
    https://www.accessforums.net/access/...ser-18344.html
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 2
    Last Post: 11-25-2013, 10:56 AM
  2. Replies: 2
    Last Post: 04-17-2012, 12:56 PM
  3. Replies: 1
    Last Post: 11-10-2011, 06:44 PM
  4. filter records to populate form on load
    By rivereridanus in forum Forms
    Replies: 3
    Last Post: 08-05-2011, 08:54 AM
  5. Form - Filter on load (if data exists)
    By dilbert in forum Forms
    Replies: 0
    Last Post: 08-13-2010, 11:39 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