Demo for Residential Plots Balloting / Draws

irsmalik

Registered User.
Local time
Today, 05:20
Joined
Jan 28, 2015
Messages
88
Hello friends,
I need some help from seniors. I have two tables
1. PlotsDetails with 2 fields
PlotID
Size

2. Customers with 3 fields
CustID
CustName
CustCellNumber

I have to create a Database for Plots Balloting/Draws.... company will arrange a ceremony for Lucky Draw and computer will select a plot from one table and customer name from other table with printing facility. Each time when this database is run, it should show Different Results.

I could not find any demo at internet... Kindly help me because I do not have any idea... how to do it ... I need an IDEA...
Thanks
Irshad Ahmed
 
Welcome to the forums! We are the most active Microsoft Access community on the internet by far, with posts going back over 20 years!

To get started, I highly recommend you read the post below. It contains important information for all new users to this forum.

https://www.access-programmers.co.uk/forums/threads/new-member-read-me-first.223250/

We look forward to having you around here, learning stuff and having fun!
 
First you need a new table--Winners, it will have 3 fields WinnerID (autonumber), PlotID (number) and CustID (number). This will hold all winning combinations and be populated by your function. That function will randomly pick 2 numbers--PotentialPlot (from 1- MAX(PlotID)) and PotentialCust (from 1-MAX(CustID)). Then you will see if that combination exists in Winners. If not you add it and thats your new winner, if it does, keep picking 2 new numbers until you having a winning combination.

Here's links to built in functions you will need:

DMAX - https://docs.microsoft.com/en-us/office/vba/api/access.application.dmax
Rnd - https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/rnd-function
Dlookup - https://support.microsoft.com/en-us/office/dlookup-function-8896cb03-e31f-45d1-86db-bed10dca5937
While - https://docs.microsoft.com/en-us/of...rence/user-interface-help/whilewend-statement
 
here is a demo.
 

Attachments

Dear arnelgp

Thank you so much ... yes this is I am looking for....
Now Plots are 50 and applicants are 500..... I want to print preview as Report by clicking Button
how can I limit to print only 50 records.

thanks
Irshad Ahmed
 
so when you click the button 50 winners will be drawn?
 
here is another demo will pick 50 winners.
 

Attachments

Dear arnelgp

Thank you so much ... yes this is I am looking for....
I never worked on Random function... but now I will work on it.

I am really thankful to Arnelgp.
Regards
Irshad Ahmed
 
Welcome. FYI, I moved your thread to a more appropriate forum.
 

Users who are viewing this thread

Back
Top Bottom