Results 1 to 5 of 5
  1. #1
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    287

    Indexing (no dupes) dates where employee code = XXXX

    Hey guys,



    I have 1 master table that holds all of my company's 200+ sales associate's pay roll data. I have built an entry form that works great, but I want to make 1 tweek.

    When you open up the entry form, a subform shows the data for the past 6 pay periods for the selected salesperson. This pulls from the master table as well. I want the entry form to not allow a date to be entered twice. The catch is, that if for Salesperson A I have entered his payroll data for pay period 11/17/13, I have to be able to enter data for the same week for Salesperson B, so just setting that field to indexed(no dupes) wouldn't cut it. So, I want dates to not allow duplicates, while a certain salesperson is selected.

    I hope I explained that well enough.

    Thanks guys!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,598
    Could try a compound index using the date and salesperson ID
    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
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    287
    Details? Makes sense, each salesperson can only have 1 date. How do I do this?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,598
    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
    snipe's Avatar
    snipe is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    287
    Awesome! I had the indexes already set up. I had no idea about the multiple-index method of not naming the second index.
    Good to know.
    Thanks June7!

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

Similar Threads

  1. Indexing question
    By Helystra in forum Database Design
    Replies: 8
    Last Post: 11-22-2013, 04:24 PM
  2. Replies: 1
    Last Post: 10-18-2013, 03:14 PM
  3. Delete Dupes
    By comfygringo in forum Queries
    Replies: 1
    Last Post: 08-10-2013, 10:26 AM
  4. Replies: 8
    Last Post: 06-06-2012, 12:28 PM
  5. Replies: 2
    Last Post: 01-13-2012, 01:25 PM

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