Help me create a database to give money away
January 16, 2008 2:41 PM
Subscribe
Help me design a small Access application to run a prize drawing. As I see it, the MC will open the application and click the Draw button, which will select from the available prizes for that month. Once drawn, that prize becomes unavailable. MC will then type in the winner's name and click Save, setting the form ready for the next contestant.
Specs and examples follow.
Prizes will be one of the following dollar denominations: 5, 10, 20, 50, 100, or Consolation Prize.
There may be more than one prize of a particular denomination, that will change from month to month.
Prizes should be chosen randomly.
Prizes cannot be given more than once. (obvious)
As an example, this months drawing may have 12 $5 prizes, 9 $10 prizes, 5 $20 prizes, 2 $50 prizes, 1 $100 prize, and 50 consolation prizes.
The application will need to be opened and closed a few times before the month's drawing is complete. Freeware applicaitons that interface with Access or Excel will be considered.
posted by kc0dxh to computers & internet (8 comments total)
1 user marked this as a favorite
Here's what it could look like:
Table: Prizes
ID, Description, DateAwarded
Table: People
ID, Name
Table: PrizeWinners
ID, PrizeID, PeopleID, DateAwarded
The 'ID' field in each table would be a unique primary key.
You would then populate the Prizes and People tables, assigning a unique ID to each record.
Then, create a relation between the three tables so that the ID fields in the Prizes and People tables each are linked to the obvious fields in the PrizeWinners table.
Finally, create a form that has a button that first queries the Prize table with SQL like "SELECT * FROM Prizes WHERE DateAwarded IsNull;" (I'm not sure if you would use IsNull or something like ="" or something else). Using the returned recordset, you would select a random number between 1 and recordset.recordcount. The random number would be the record number, which would be updated by having its DateAwarded field updated.
If you have a People table, you could do the same thing to randomly pick a person if you'd like.
Then, append a new record to the PrizeWinners table with the PrizeID, the PeopleID and the DateAwarded fields.
Finally, display the prize (and winner).
Make sure that the computer is physically secured, and password protect the .mdb file (encrypt it on a thumbdrive that you keep in a safe place for even more security).
posted by i love cheese at 3:35 PM on January 16, 2008