 |
Form Code for Aggregation Mini-Lecture: Day 3
Option Explicit
Private Const OK As Integer = vbOKOnly
Private Const MessageTitle As String = "Pet Care Error"
Private strPetType As String
Private intTypeCare As Integer
Private PetCare As Object
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
If ValidatedInput Then
Dim intPetType As Integer
intPetType = lstPetType.ItemData(lstPetType.ListIndex)
Select Case intPetType
Case 1
Set PetCare = New clsCat
Case 2
Set PetCare = New clsDog
Case 3
Set PetCare = New clsReptile
Case 4
Set PetCare = New clsRodent
End Select
With PetCare
.PetType = strPetType
.CareType = optPetCare(intTypeCare).Caption
Select Case intTypeCare
Case 0
MsgBox .Food, OK, "Pet Care"
Case 1
MsgBox .Cleaner, OK, "Pet Care"
Case 2
MsgBox .Exercises, OK, "Pet Care"
Case 3
MsgBox .Attentions, OK, "Pet Care"
Case 4
MsgBox .VetVisitations, OK, "Pet Care"
End Select
End With
Set PetCare = Nothing
lstPetType.ListIndex = -1
optPetCare(intTypeCare) = False
End If
End Sub

Alrak's Course Resources ©2002-2007 Karla Carter. All rights reserved. This material
(including, but not limited to, Mini-lectures and Challenge Labs) may not be reproduced, displayed, modified or distributed without the express prior written permission
of the copyright holder. For permission, contact
Karla.
|