Results 1 to 5 of 5
  1. #1
    Heatshiver is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2011
    Posts
    128

    Question Different User IDs for Same Date, but Not Same User ID for Same Date

    I have two tables, a tblUsers and a tblDailyReport.

    The tblUsers only stores a User ID. The tblDailyReport stores both the Date and the User ID. I have a relationship from tblUsers to the User ID on tblDailyReport. tblUsers has its primary key set to User ID. While tblDailyReport currently has no primary key.

    When I use it this way I can have a User ID use more than one date. The issue here is that I can also have the User ID use the same date numerous times and have it stored in the tblDailyReport, creating multiple records for the same User ID and date.

    If I make the Date in tblDailyReport a primary key, I can only use one User ID per date.



    I need to ultimately have the same date but for different User IDs. However, I can't have duplicate records of the same date and User ID. What can I do to fix this?

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,849
    What exactly are you trying to do?
    What is the purpose of each table?
    What is the application?
    What is the significance of UserId and Date?

  3. #3
    Heatshiver is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2011
    Posts
    128
    I am trying to be able to have different users fill out the same date as different records.

    The tblUsers is so that the admins can input User IDs when they need to. The tblDailyReport is for the information that the user will fill out.

    The application is for users to fill out daily reports.

    UserID is significant because it ensures that only people given access can use the forms. The date is significant as it will be part of the search criteria for entering information on the forms and daily reports. They are in separate tables so that UserID isn't based on date, as it shouldn't be. However, the information filled out needs to not only have the UserID but the date the information was filled.

  4. #4
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,849
    Sorry, but your explanation hasn't helped me.
    If you had to explain your situation to someone in a lineup at McDonald's, who knew nothing about Access or database, what would you say?

  5. #5
    Heatshiver is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2011
    Posts
    128
    Sorry, not always good at explanations.

    What ended up fixing this is using a compound index primary key for User ID & Date on tblDailyReports. Now I can have different users make records for the same date, but a single user cannot make multiple entries for the same date.

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

Similar Threads

  1. MS Access Date filter basedon User Input
    By shanmugamgsn in forum Access
    Replies: 1
    Last Post: 12-12-2011, 04:15 PM
  2. Replies: 9
    Last Post: 10-01-2010, 05:50 PM
  3. Replies: 1
    Last Post: 07-07-2010, 04:22 PM
  4. user selected date query
    By jamin14 in forum Queries
    Replies: 3
    Last Post: 03-31-2010, 02:11 PM
  5. Help!!! user friendly forms/date entry
    By megank in forum Access
    Replies: 3
    Last Post: 03-31-2009, 09:47 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