Results 1 to 4 of 4
  1. #1
    cjbuechler is offline Novice
    Windows Vista Access 2000
    Join Date
    May 2009
    Posts
    25

    Calculation on unique entries

    I have a table of ContestEvents, a table of Entires, and a table of Contestants.



    Each contestant can have multiple entries in the Entries table for a single event. As you can image that’s all easy enough.
    ENTRIES looks something like this:
    ENTRYID /CONTESTANTID /CONTESTID
    1 /111 /2010
    2 /111 /2010
    3 /112 /2010
    4 /112 /2010
    5 /113 /2010

    I run into a problem when I have one of the fields on the Entries form calculated during data entry.

    The problem is I only want the calculated field to “calculate” if this is the Contestant’s first entry. If this is the second or more then it should not do the calculation on that field. Using the mock table above I would apply it to entryid 1, 3, and 5 and when someone had gone to enter in the others the coding in the form would not have applied the calculation.

    I’m thinking I need a query that groups the entries table so that I get EVENTID (Group by), CONTESTANTID (Group By), and ENTRYID (Min)… I was thinking MIN since the EVENTID’s are auto-generated sequencial numbers. From there I'm not sure how to compare against that query in the coding of the form and whether or not thats the right route to begin with.

    Any help would be great. Thanks!
    Last edited by cjbuechler; 05-17-2010 at 09:16 AM.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Why 5? That's 111's third entry. I think you're on the right track. See if this helps:

    http://www.baldyweb.com/LastValue.htm
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    cjbuechler is offline Novice
    Windows Vista Access 2000
    Join Date
    May 2009
    Posts
    25
    Thanks, I'll take a look at that.

    You're right. I copied and pasted and forgot to edit the ContestantID.

  4. #4
    cjbuechler is offline Novice
    Windows Vista Access 2000
    Join Date
    May 2009
    Posts
    25
    Update: Luckily due to the nature of the data I was able to make a query that gave me the MIN of the ENTRYID for each CONTESTANTID. There were some cases where that didn't work but they were not the norm.

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

Similar Threads

  1. Count of Unique Values
    By vsmk in forum Queries
    Replies: 2
    Last Post: 03-14-2010, 12:07 AM
  2. how to set a unique ID
    By archie in forum Access
    Replies: 1
    Last Post: 09-08-2009, 04:28 AM
  3. Need Help Summing UNIQUE Records
    By Millerguitarworks in forum Access
    Replies: 5
    Last Post: 05-27-2009, 04:37 PM
  4. Unique Puzzle
    By Christina G in forum Database Design
    Replies: 0
    Last Post: 03-14-2009, 06:37 PM
  5. query that will contain all unique records
    By halcolm1 in forum Queries
    Replies: 0
    Last Post: 01-19-2007, 05:34 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