The code I have put below, I have a problem with. I'm using a graphing control I got off the net, and I cannot for the life of me figure out how to put the values of an array into the display function. If anyone has ANY insight or ideas on how to graph the values from an array, that would be incredibly helpful.

Private Sub Command1_Click()
'this button is the first integral part of the program. The purpose of this function is to allow the user to compare
'different dice pools with different probabilities of success. The number of dice and successes is fixed, but with a dynamic number of botches and failures.

dicerolled = (Val(n.Text))
successes = (Val(k.Text))
p = Val(psuccess.Text)
q = Val(pbotch.Text)
r = (1 - p - q)

'the following section here is some basic error code:
If n.Text = "" Then MsgBox "You can't leave the dice rolled field blank!", vbOKOnly, "Error1a"
If k.Text = "" Then MsgBox "You can't leave the successes field blank. ", vbOKOnly, "Error3a"
If psuccess.Text = "" Then MsgBox "You can't leave the probability field blank", vbOKOnly, "Error4a"
If pbotch.Text = "" Then MsgBox "You can't leave the botch field blank", vbOKOnly, "Error5"
If n.Text = 0 Then MsgBox "You can't roll zero dice.", vbOKOnly, "Error1"
If n.Text = 1 Then MsgBox "If you can't figure out the probability with one die, you're pretty dumb!", vbOKOnly, "Error2"
If k.Text = 0 Then MsgBox "You can't have 0 successes.", vbOKOnly, "Error3"
If psuccess.Text = 0 Then MsgBox "You can't have a probability of success of ZERO%!!", vbOKOnly, "Error4"




botches = -1
counter = -1
'counter and botches are -1 because the probability must be first calculated with the number of botches equal to zero.


Do Until counter = (dicerolled - successes)
'this calculation is one of the most important parts of the program. Without this trinomial formula 3 event uniform probabilities would NOT be able to calculated.
botches = botches + 1
counter = counter + 1
nfactorial = nn(dicerolled)
kfactorial = kk(successes)
failures = (dicerolled - successes - botches)
lfactorial = ll(botches)
mfactorial = mm(failures)
pofsuccess = (nfactorial / (kfactorial * lfactorial * mfactorial)) * (p ^ successes) * (q ^ botches) * (r ^ (dicerolled - successes - botches))
isolatedprobabilityholder(counter) = pofsuccess
'the array here is for the purposes of creating a graph from the data calculated


ReDim mydata(counter, counter) As Variant
For i = 0 To counter
mydata(0, i) = 0
mydata(counter, i) = isolatedprobabilityholder(counter)
Next i
GraphLite1.BackColor = &HFFFFFF 'white
GraphLite1.RegisterData mydata()
GraphLite1.Title = "Probability Distribution"
GraphLite1.LowScale = 0
GraphLite1.HighScale = 1
GraphLite1.VerticalTickInterval = 0.05
GraphLite1.HorizontalTickFrequency = counter
GraphLite1.ChartType = 1

Loop

'this next long piece of code is the process that lets me construct a graph from the data procured earlier.

GraphLite1.Refresh

End Sub