Hi Everybody. I am trying to make a Black Jack program which can randomize numbers witin a specific range and then count them and stop if a certain value are reached. So If I randomizes and gets 7, 8 and 10 a function counts that 7 + 8 = 15 and 15 + 10 = 25.
25 would be too much so it then states that the game is over via a If AddACard <= 21 GameOver. But I'm not really there yet. I'm stuck at the part where the counter should count the randomized numbers.

I've tried with different ways but it never works, it just attaches to the randomizer and dynamically change every time the randomizer calls a number or randomizes two numbers every time the randomizer does one number.

I have One button and two labels. The button randomizes(draws a card) a number, and Label1 displays it. Label2 Is meant to serve as a counter and display the cards you've drawn and add them.

This is the Randomize Function.

Code:
Function GetACard() As Integer
Randomize
GetACard = Int(14 * Rnd + 1)
End Function
Here's button one.

Code:
Private Sub Command1_Click()
GetACard ' Calls the Randomize Function.
Label1.Caption = GetACard ' Puts Randomized Number in Label1
AddACard ' This is where the problem starts.
End Sub
Code:
Function AddACard() As Integer ' This doesn't seem to Work. Seems to Randomize two numbers. 
AddACard = GetACard
AddACard = AddACard + GetACard
Label2.Caption = GetACard
End Function
Does anyone have a clue how to make it add the numbers and store them?

Thanks in Advance!

Mike