VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   1365
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   3555
   LinkTopic       =   "Form1"
   ScaleHeight     =   1365
   ScaleWidth      =   3555
   StartUpPosition =   3  'Windows Default
   Begin VB.CheckBox Check1 
      Caption         =   "Check 3"
      Height          =   255
      Index           =   2
      Left            =   2280
      TabIndex        =   4
      Top             =   360
      Width           =   1215
   End
   Begin VB.CheckBox Check1 
      Caption         =   "Check 2"
      Height          =   255
      Index           =   1
      Left            =   1200
      TabIndex        =   3
      Top             =   360
      Width           =   975
   End
   Begin VB.CheckBox Check1 
      Caption         =   "Check 1"
      Height          =   255
      Index           =   0
      Left            =   120
      TabIndex        =   2
      Top             =   360
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Command1"
      Height          =   375
      Left            =   1320
      TabIndex        =   1
      Top             =   840
      Width           =   1215
   End
   Begin VB.TextBox Text1 
      Height          =   375
      Left            =   120
      TabIndex        =   0
      Top             =   840
      Width           =   735
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim i As Integer
Dim strNumString As String
Dim strNums() As String

    'see which checkboxes are checked and
    'add the possible numbers to a string
    For i = 0 To 2
        If Check1(i).Value = vbChecked Then
            strNumString = strNumString & Check1(i).Tag
        End If
    Next i
        
    'Spliting the number string on the space will
    'add all the possiblities to an array
    strNums = Split(strNumString, " ")
    
    'Select a random index from the array
    Randomize
    i = Int(Rnd() * (UBound(strNums)))
    
    'display the results
    Text1.Text = strNums(i)
  
End Sub

Private Sub Form_Load()
    'add the values for each checkbox
    'note the trailing space is important
    Check1(0).Tag = "1 2 3 "
    Check1(1).Tag = "4 5 6 "
    Check1(2).Tag = "7 8 9 "
    
    Check1(0).Caption = "Geo"
    Check1(1).Caption = "Bio"
    Check1(2).Caption = "Math"
End Sub

