Voting on Records from another table

TerribadCoder

Registered User.
Local time
Yesterday, 20:12
Joined
Mar 8, 2014
Messages
20
OK, this has been stumping me for quite some time. What I would like to do is have about 10 users fill out an Options Group in another table (tblVote, [field Vote]) while referencing specific records in another table (tblRequests, [field ID]).

The part I can't wrap my head around, which is probably fundamental, is linking the (tblVote, [field Vote]) to (tblRequests, [field ID]). The field ID in tblRequests needs to have up to 10 separate "votes" in tblVote.

Any assistance is appreciated!
 
Are you saying you have multiple users, each with a UserID who are voting Yes or No on a number of Requests, each of which has a RequestID?

If so it seems to me your tblVotes should have the following fields
VoteID (PK)
RequestID
UserID
Vote

A unique index on the combined filelds RequestID and UserID, would prevent any user lodging multiple votes for any particular request.
 
I have multiple users that will be voting on one particular record in separate table. I'm having a couple issues here.
1. Linking the one request table record to multiple records in the voting table.
2. Ensuring a unique UserID can only vote once per request record.

I'm positive there is something fundamental that I'm leaving out. Or perhaps I'm going about this completely wrong. Thanks for the input!
 
What are the field names in the tables you currently have?
 
Hi Cronk. The two tables are set up in this fashion.

tblRequests
ID (PK) - Autonumber
Requestor - Text
Start Date - Date/Time
Request - Text

tblVote
VoteID (PK) - Autonumber
RequestID - Number
PersonID - Text (Pulled from active directory using a Module)
Vote - Number (depending on option group control)
 
I can't see your issue.

(1) A query based on your tables tblRequests and tblVote joined on tblRequests.ID = tblVote.RequestID will give you every PersonID who voted on RequestID.

(2) As I wrote in #2
A unique index on the combined fields RequestID and UserID, would prevent any user lodging multiple votes for any particular request. Google search create multiple field index.
 
Cronk, THANK YOU! Creating the multiple field index was exactly what I needed to do.

I had a problem displaying all that information on one form as well, until I read about the subform feature. You rock!
 

Users who are viewing this thread

Back
Top Bottom