Results 1 to 5 of 5
  1. #1
    whitneynf08 is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2012
    Posts
    5

    Creating filters in forms using Parameters

    I am creating a front end of a database that is the forms only version with ext. .accdr



    I would like to create a way that each user of the front end can apply a filter using parameters, allowing the user to enter in their name when opening the front end.

    Form and Table name is "Non-Student Tasks Completed Daily" and "Student Connection Task"
    Field name is "SSC"

    How can I get a box to appear when someone opens the database that askes them to enter their name to apply the filter?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    You could have a form set as the default when database opens. From ribbon > File > Options > CurrentDatabase > DisplayForm
    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.

  3. #3
    theosgood is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jun 2012
    Location
    Denver, CO
    Posts
    30
    I use the the Environ function to get that information from the system so the users don't need to enter anything when opening the database.

    FYI.. I am running Access 2007 but opening a database in Access 2003 format.

    In Visual basic add this function, I have it in Globals:

    Public Function Environ(Expression)
    Environ = VBA.Environ(Expression)
    End Function

    Create a table: tblUsers
    User Text 255
    LoginTime Date/Time
    (you can also add a logout time if appropriate and add it to your close database routine. Also requires changing the query below to append.)

    Create a make table query: qryUserLogin
    SELECT Environ("UserName") AS [User], Now() AS LoginTime INTO tblUsers

    In my AutoExec macro I have the following:
    Action = Open Query
    Query Name:qryUserLogin
    View: Datasheet
    Data Mode: Edit

    I then open a switchboard form that directs then to forms, reports etc.
    Action = OpenForm
    Form Name: Switchboard

    I also use the Set Warnings = True or False Action from Access 2003 to stop the query message popups. I think you have to disable it in Access Options in 2007.

    How to use this:

    On the reports that are user specific I add the tblUsers to the report query as an outer join so that it only pulls report data for that user.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,898
    I do something very similar.

    I also use Environ function to get the USERNAME but if user is not already in table the login form pops up so user can input initials (we use initials elsewhere). User never sees the login again.

    But why a make table query? Is that just a one-time action to set up the permanent table?
    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.

  5. #5
    theosgood is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jun 2012
    Location
    Denver, CO
    Posts
    30
    Personal preference. I do the make table so that it only has one record, the current user. Then I don't need any additional criteria in the user specific queries, just the join. You could append each time and add max criteria to your query but eventually you'll have to maintenance the table. Just one less thing to do.

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

Similar Threads

  1. Navigation Forms and Filters
    By Trichmond in forum Forms
    Replies: 2
    Last Post: 10-10-2012, 03:26 PM
  2. Help Creating Forms & Subforms
    By tlasenby in forum Forms
    Replies: 1
    Last Post: 08-22-2012, 09:02 AM
  3. Replies: 2
    Last Post: 04-12-2012, 05:16 PM
  4. Replies: 7
    Last Post: 08-04-2011, 07:49 PM
  5. Creating Filters on a Form
    By Nixx1401 in forum Access
    Replies: 4
    Last Post: 02-27-2010, 05:32 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