|
-
Mar 18th, 2010, 02:16 PM
#1
Thread Starter
New Member
[RESOLVED] Randomize forms in VB6
I originally was given 10 forms, each with 4 songs, to be played in random order (no repeats) and decided, for time and sanity sake to duplicate the forms. Now I have 40 forms to be presented randomly. The challenge for me is the first time the forms are called, they come from one location, the remaining 39 times come from another location.
On a recommendation, I used
Code:
Private Sub cmdNext_Click()
Dim adu As String
adu = Rand(1, 40)
Select Case adu
Case 1
frm1.Show
Case 2
frm2.Show
Case 3
frm2.Show
Case 4
frm4.Show
etc..
Case 40
frm40.Show
with the Rand function. However, I am getting duplicates (obviously) and wonder if anyone can offer a better option or modification I can make. I am not a programmer by trade, just by necessity. Would it be better to use flags?
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|