Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Random Generated Report Fields

Status
Not open for further replies.

JferWfer

IS-IT--Management
Sep 18, 2002
16
US
Hi, I need to make BINGO cards in access using a table of names & words. How would I tell access to randomly populate 24 fields for 24 squares and NOT have any duplicates within. I'm stumped......

Thanks,
Jen
 
That looks like a great software if this were a standard numeric bingo (unless you can use text). The bingo cards need to be generated from a playlist of songs and artists already in my database. There are no B I N G O column headers, just 24 sqares of artists and songs and 1 free space. I was looking at the rnd function but it seems I would have to run my query for each card. Do you know if you can change the code in BINGOWARE to use my access table text?

Thanks,
Jen
 
You can use rnd to pick the top 24 randomly sorted records. For example:

[tt]SELECT TOP 24 Rnd([ID]) AS SortExpr, Table1.ID, Table1.FieldX
FROM Table1
ORDER BY Rnd([ID])[/tt]
 
So if that were setup in my report I would only be getting one card, correct? Am I dreaming to have it create, lets say 50 cards in a report - all of which are different? I did send an email to Bingoware asking if they could customize it so that I could use the card generating function with my database - no answer as of yet.
 
If I wanted to create a random bingo card of 9 employees in Northwind, I would:
1) create a table of all numbers
tblNums.Num
2) add all numbers from 1 to 100
3) create a query (qcartEmployeeBingo) with SQL of
Code:
SELECT tblNums.Num, Rnd([EmployeeID]) AS RandomOrder, Employees.LastName
FROM Employees, tblNums
WHERE tblNums.Num<=50;
4) Create a new report based on qcartEmployeeBingo
5) set the sorting and grouping to
Num (each Num should start a new page)
Random Order
6) Set the detail section to the size of a bingo square and add a text box to display the value.
7) add a transparent rectangle around the detail section
8) go to the Page Setup - Columns and define 3 columns (3x3=9)
9) No column spacing and column size the same as the detail
10) Save and then view the report.

If you have a free square you can use a union query to add a single "FREE SPACE" record to the "employee table". Then use the union query rather than the employee table in the qcartEmployeeBingo query.

Rather than a 3 column report, you will need a 5 column report.



Duane MS Access MVP
Now help me support United Cerebral Palsy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top