|
-
May 19th, 2005, 05:45 AM
#1
Thread Starter
New Member
heeelpppppppppp
what would the interface look like for this code?
Private Sub Form_Load()
Option Explicit
Dim i As Integer
Dim MyRecord(1 To 7, 1 To 1) As Long
'Array 1 to 5 are the candidates
'Array 6 is dummy votes
'Array 7 is total votes
Randomize
Dim Vote As Integer
For i = 1 To 10
'Set caption to random a randome number from 1 to 10
Vote = Int(10 * Rnd) + 1
If Vote <= 5 Then
MyRecord(Vote, 1) = MyRecord(Vote, 1) + 1
Else
MyRecord(6, 1) = MyRecord(6, 1) + 1
End If
MyRecord(7, 1) = MyRecord(7, 1) + 1
Next
For i = 1 To 7
Debug.Print MyRecord(i, 1)
Next
End Sub
End Sub
would be appreaciated ! I really need help!!
-
May 19th, 2005, 05:57 AM
#2
Re: heeelpppppppppp
Hi mematoots,
welcome to the forum
By interface u mean the form outlook?
Anyway the code won't work. U need to correct it first. (Option Explicit inside a sub, 2 End Sub's etc.)
Pradeep
-
May 19th, 2005, 06:01 AM
#3
Re: heeelpppppppppp
This was the firs run:
Second Run: (see the problem, yet?)
Last time:
Last edited by dglienna; May 19th, 2005 at 06:05 AM.
-
May 19th, 2005, 08:39 AM
#4
Re: heeelpppppppppp
Here's the scoop.
1) Take Option Explicit out of the the sub and put it in the General Declarations which is the very top of the code window.
2) Use [Highlight=VB] tags around vb code
3) Use sensible thread titles please. Using thread titles like "Help" or "Noobie" or "Problem with my code", etc. is not good and will tend to turn people away. But using titles like "Command Button not working", or "Dividing without dividing", etc., is more specific and breif and will get you more help.
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
|