Bushra Eisa
New member
- Local time
- Today, 10:48
- Joined
- Mar 3, 2020
- Messages
- 2
this is my first timeusing Microsoft Access and i'm having diffuclties completeling a task at my internship. I was given a list of records and i'm supposed to create a query that picks random records (winners) based on the country and the year of choice. I created a form with two dropdown lists for the countries and the years and a textbox where the user would select the number of winners.
I was only able to do the randomizing bit by implementing the following SQL code:
My problem now is that I want to choose the number of winners and select the country from dropdown list in my form and the year and filter the records based on the selection.
Hope it made sense.
Any help would be appreciated!
I was only able to do the randomizing bit by implementing the following SQL code:
Code:
`SELECT TOP 10 Sheet2.name, Sheet2.country, Sheet2.Year
FROM Sheet2
ORDER BY Rnd(-(100000*ID)*Time());
My problem now is that I want to choose the number of winners and select the country from dropdown list in my form and the year and filter the records based on the selection.
Hope it made sense.
Any help would be appreciated!