VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form frmImage 
   Caption         =   "Student DataBase Input Screen"
   ClientHeight    =   5550
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   7200
   LinkTopic       =   "Form1"
   ScaleHeight     =   5550
   ScaleWidth      =   7200
   StartUpPosition =   3  'Windows Default
   Begin VB.VScrollBar vsbGrade 
      Height          =   735
      Left            =   2640
      Max             =   6
      Min             =   1
      TabIndex        =   16
      Top             =   3120
      Value           =   1
      Width           =   135
   End
   Begin VB.CommandButton cmdProfile 
      Caption         =   "&Display Profile"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   600
      TabIndex        =   15
      Top             =   4920
      Width           =   2055
   End
   Begin VB.VScrollBar vsbYear 
      Height          =   735
      LargeChange     =   10
      Left            =   2400
      Max             =   2001
      Min             =   1900
      TabIndex        =   13
      Top             =   1560
      Value           =   1950
      Width           =   255
   End
   Begin VB.ComboBox cboMonth 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      Left            =   1080
      TabIndex        =   11
      Text            =   "Month"
      Top             =   1560
      Width           =   1095
   End
   Begin VB.ComboBox cboDate 
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   315
      Left            =   0
      TabIndex        =   8
      Text            =   "Date"
      Top             =   1560
      Width           =   975
   End
   Begin VB.CommandButton cmdExit 
      Caption         =   "E&xit"
      Height          =   495
      Left            =   5760
      TabIndex        =   5
      Top             =   4200
      Width           =   1335
   End
   Begin VB.CommandButton cmdShow 
      Caption         =   "&Show Image"
      Default         =   -1  'True
      Height          =   495
      Left            =   4080
      TabIndex        =   4
      Top             =   4200
      Width           =   1455
   End
   Begin MSComDlg.CommonDialog cdlExample 
      Left            =   3120
      Top             =   4920
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
      DialogTitle     =   "Open Example"
      Filter          =   "Bitmaps(*bmp)|*.bmp"
   End
   Begin VB.Frame fraGender 
      Caption         =   "Sex"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   975
      Left            =   0
      TabIndex        =   3
      Top             =   3600
      Width           =   1455
      Begin VB.OptionButton optFemale 
         Caption         =   "Female"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   19
         Top             =   600
         Width           =   1215
      End
      Begin VB.OptionButton optMale 
         Caption         =   "Male"
         BeginProperty Font 
            Name            =   "MS Sans Serif"
            Size            =   9.75
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   120
         TabIndex        =   18
         Top             =   240
         Value           =   -1  'True
         Width           =   975
      End
   End
   Begin VB.TextBox txtName 
      Alignment       =   2  'Center
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   240
      TabIndex        =   1
      Text            =   "Type Name Here"
      Top             =   360
      Width           =   2655
   End
   Begin VB.Label lblGrade 
      Alignment       =   2  'Center
      BackColor       =   &H00FFFFFF&
      BorderStyle     =   1  'Fixed Single
      Caption         =   "1"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   3000
      TabIndex        =   17
      Top             =   3240
      Width           =   375
   End
   Begin VB.Label lblYearBorn 
      Alignment       =   2  'Center
      Caption         =   "Year"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   2760
      TabIndex        =   14
      Top             =   1200
      Width           =   735
   End
   Begin VB.Label lblYear 
      Alignment       =   2  'Center
      BackColor       =   &H00FFFFFF&
      BorderStyle     =   1  'Fixed Single
      Caption         =   "Year"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   2760
      TabIndex        =   12
      Top             =   1560
      Width           =   855
   End
   Begin VB.Label lblMonth 
      Alignment       =   2  'Center
      Caption         =   "Month"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   1080
      TabIndex        =   10
      Top             =   1200
      Width           =   735
   End
   Begin VB.Label lblDate 
      Alignment       =   2  'Center
      Caption         =   "Date"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   0
      TabIndex        =   9
      Top             =   1200
      Width           =   855
   End
   Begin VB.Label lblAge 
      Alignment       =   2  'Center
      Caption         =   "Age"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   1200
      TabIndex        =   7
      Top             =   840
      Width           =   615
   End
   Begin VB.Label lblImage 
      Alignment       =   2  'Center
      BorderStyle     =   1  'Fixed Single
      Height          =   375
      Left            =   4080
      TabIndex        =   6
      Top             =   5040
      Width           =   3015
   End
   Begin VB.Shape Shape2 
      BackColor       =   &H00FFFFFF&
      BackStyle       =   1  'Opaque
      Height          =   2775
      Left            =   4440
      Top             =   480
      Width           =   2055
   End
   Begin VB.Shape Shape1 
      BackColor       =   &H00C0E0FF&
      BackStyle       =   1  'Opaque
      BorderStyle     =   6  'Inside Solid
      BorderWidth     =   5
      FillColor       =   &H00C0FFFF&
      FillStyle       =   7  'Diagonal Cross
      Height          =   3615
      Left            =   4200
      Shape           =   4  'Rounded Rectangle
      Top             =   120
      Width           =   2655
   End
   Begin VB.Image imgImage 
      BorderStyle     =   1  'Fixed Single
      Height          =   2775
      Left            =   4440
      Stretch         =   -1  'True
      Top             =   480
      Width           =   2055
   End
   Begin VB.Line Line1 
      BorderWidth     =   3
      X1              =   3840
      X2              =   3840
      Y1              =   0
      Y2              =   5520
   End
   Begin VB.Label lblStudentGrade 
      Alignment       =   2  'Center
      Caption         =   "Student Grade"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   1680
      TabIndex        =   2
      Top             =   2640
      Width           =   2055
   End
   Begin VB.Label lblName 
      Alignment       =   2  'Center
      Caption         =   "Student Name"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   255
      Left            =   480
      TabIndex        =   0
      Top             =   0
      Width           =   2415
   End
End
Attribute VB_Name = "frmImage"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False






Private Sub cmdDisplay_Click()
cdlExample.ShowOpen
lblExample.Caption = cdlExample.FileName
End Sub


Private Sub cmdExit_Click()
End
End Sub


[vbcode]Private Sub cmdProfile_Click()
Dim Message As String
Dim StudentAge As String
Dim StudentDate As Date
Dim IsDate As Variant
Message = txtName.Text + " is a student in the" + lblGrade.Caption + vbCr
If lblGrade.Caption = 1 Then
Message = txtName.Text + " is a student in the First Grade" + vbCr
End If
If lblGrade.Caption = 2 Then
Message = txtName.Text + " is a student in the Second Grade" + vbCr
End If
If lblGrade.Caption = 3 Then
Message = txtName.Text + " is a student in the Third Grade" + vbCr
End If
If lblGrade.Caption = 4 Then
Message = txtName.Text + " is a student in the Fourth Grade" + vbCr
End If
If lblGrade.Caption = 5 Then
Message = txtName.Text + " is a student in the Fifth Grade" + vbCr
End If
If lblGrade.Caption = 6 Then
Message = txtName.Text + " is a student in the Sixth Grade" + vbCr
End If
'Calculate students age
StudentDate = CDate(cboDate.Text & "/" & cboMonth.Text & "/" & lblYear.Caption)
StudentAge = DateDiff("yyyy", StudentDate, Now())
If Month(Now) < Val(cboMonth.Text) Then
   StudentAge = StudentAge - 1
ElseIf Month(Now) = Val(cboMonth.Text) Then
 If Day(Now) < Val(cboDate.Text) Then
   StudentAge = StudentAge - 1
  End If
 End If
 Debug.Print StudentAge
If IsDate(StudentDate) Then
StudentDate = CDate(cboDate.Text & "/" & cboMonth.Text & "/" & lblYear.Caption)
StudentAge = DateDiff("yyyy", StudentDate, Now())
If Month(Now) < Val(cboMonth.Text) Then
   StudentAge = StudentAge - 1
ElseIf Month(Now) = Val(cboMonth.Text) Then
 If Day(Now) < Val(cboDate.Text) Then
   StudentAge = StudentAge - 1
  End If
 End If
Else
MsgBox "Invalid Date", vbRetryCancel
End If
'Display Student name, grade and gender
If optMale.Value = True Then
Message = Message + "He is " + StudentAge + " Years Old"
MsgBox Message, vbOKOnly, "Student Profile" + vbCr
End If
If optFemale.Value = True Then
Message = Message + "She is " + StudentAge + " Years Old"
MsgBox Message, vbOKOnly, "Student Profile" + vbCr
End If

End Sub

[/vbcode]
Private Sub cmdShow_Click()
'Put image file name together and
'load image into image box
Dim ImageName As String
'Check to see if a root directory
If Right(filImage.Path, 1) = "\" Then
 ImageName = filImage.Path + filImage.FileName
Else
ImageName = filImage.Path + "\" + filImage.FileName
End If
lblImage.Caption = ImageName
imgImage.Picture = LoadPicture(ImageName)
End Sub


Private Sub Form_Load()
'Add dates to combo box 1
cboDate.Clear
cboDate.AddItem "1"
cboDate.AddItem "2"
cboDate.AddItem "3"
cboDate.AddItem "4"
cboDate.AddItem "5"
cboDate.AddItem "6"
cboDate.AddItem "7"
cboDate.AddItem "8"
cboDate.AddItem "9"
cboDate.AddItem "10"
cboDate.AddItem "11"
cboDate.AddItem "12"
cboDate.AddItem "13"
cboDate.AddItem "14"
cboDate.AddItem "15"
cboDate.AddItem "16"
cboDate.AddItem "17"
cboDate.AddItem "18"
cboDate.AddItem "19"
cboDate.AddItem "20"
cboDate.AddItem "21"
cboDate.AddItem "22"
cboDate.AddItem "23"
cboDate.AddItem "24"
cboDate.AddItem "25"
cboDate.AddItem "26"
cboDate.AddItem "27"
cboDate.AddItem "28"
cboDate.AddItem "29"
cboDate.AddItem "30"
cboDate.AddItem "31"
cboDate.ListIndex = 0

'Add Months to combo box2
cboMonth.Clear
cboMonth.AddItem "1"
cboMonth.AddItem "2"
cboMonth.AddItem "3"
cboMonth.AddItem "4"
cboMonth.AddItem "5"
cboMonth.AddItem "6"
cboMonth.AddItem "7"
cboMonth.AddItem "8"
cboMonth.AddItem "9"
cboMonth.AddItem "10"
cboMonth.AddItem "11"
cboMonth.AddItem "12"
cboMonth.ListIndex = 0

End Sub


Private Sub VScroll1_Change()

End Sub


Private Sub vsbDate_Change()

End Sub


Private Sub vsbGrade_Change()
Dim Grade As Integer
Grade = vsbGrade.Value
lblGrade.Caption = Str(Grade)
End Sub

Private Sub vsbYear_Change()
'Read Date and display in label box
DOB = vsbYear.Value
lblYear.Caption = Str(DOB)
End Sub

Private Sub vsbYear_Scroll()
'Read Date and display in label box
DOB = vsbYear.Value
lblYear.Caption = Str(DOB)

End Sub


