Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2005
    Posts
    220

    Unanswered: OpenTable method

    Is there a way to open a table in VBA and have it only disply records that meet a certain criteria? I have a table that has records for various planner codes. When the planner opens the table, I want them to only see their records and nobody elses.

  2. #2
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    1. No.

    2. Don't even try to go there.

    i regularly break almost all the rules when is suits me, but the one thing that i would NEVER do is let a user see a table.

    if you are really desperate to make a bad solution, at least show the user a query on the table: the query (with suitable criteria) will show only the records you want shown.

    in case you didn't notice from the previous sentence, i think it's crappy programming to show the user a query (with edit access) and i only break that rule for my own-use stuff.

    izy
    currently using SS 2008R2

  3. #3
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    What you're looking for is along the lines of page-level security. I've seen that in report writers, but it isn't there in Access.

    One good workaround is to give each planner an ID. If you are using
    Access security, you can use CurrentUser() to find the planners name.
    Build a table:

    PLANNER
    --------
    Planner_ID AutoNumber PrimaryKey
    Planner_Name Text (store the user names here)

    For the tables that are planner specific, add a planner_id field.

    Make the recordsource for your form something along the lines of:
    Select mytable.* from mytable inner join planner on mytable.planner_id = planner.planner_id
    Where planner.planner_name=CurrentUser()
    Inspiration Through Fermentation

  4. #4
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    I'll echo what Izy said too...
    NEVER let your users get directly at the data. They'll hose it up.
    Make them do everything in forms, where you can control what makes it to
    (or gets deleted from) the tables.
    Inspiration Through Fermentation

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •