You are on page 1of 90

Datamex Institute of Computer Technology

2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,


Caloocan City, Metro Manila

FORM 1
Private Sub Command1_Click()
If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "Select count(User) as cnt from Admin where User like '" & Text1.Text & "' and pass like '" &
Text2.Text & "' and AccountType like '" & Combo1.Text & "' ", Cn, 1, 4

If Rs!cnt = 0 Then
MsgBox "Sorry, Invalid username or password"
Text1.Text = ""
Text2.Text = ""

lbl_tries.Caption = Val(lbl_tries.Caption) - 1
If lbl_tries.Caption = 0 Then
MsgBox "SORRY TOO MUCH ATTEMPT", vbCritical, "FATAL ERROR"
End
Else
End If
Else

If Combo1.Text = "User" Then


Form2.PRODUCTMNGMNT.Enabled = False
Form2.MenuSold.Enabled = False
Form2.Show
Unload Me
Else
Form2.Show
Unload Me
End If
End If
End Sub

PETSHOP INVENTORY SYSTEM Page 17


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

FORM 2
Private Sub ManageCages_Click()
Cage_form.Command1.Visible = False
Cage_form.Frame1.Visible = True
Cage_form.Show
End Sub

Private Sub ManagePetFOod_Click()


PetFood_form.Command1.Visible = False
PetFood_form.Frame1.Visible = True
PetFood_form.Show
End Sub

Private Sub menuBird1_Click()


Bird_form.Command1.Visible = False
Bird_form.Frame1.Visible = True
Bird_form.Show
End Sub
Private Sub menuBirds_Click()
Bird_form.Show
End Sub
Private Sub MenuCages_Click()
Cage_form.Show
End Sub

Private Sub menucat_Click()


Cat_form.Show
End Sub

Private Sub menucat1_Click()


Cat_form.Command1.Visible = False
Cat_form.Frame1.Visible = True
Cat_form.Show
End Sub

Private Sub menudog_Click()


Dog_form.Show
End Sub

Private Sub menudog1_Click()


Dog_form.Command1.Visible = False
Dog_form.Frame1.Visible = True

PETSHOP INVENTORY SYSTEM Page 18


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Dog_form.Show
End Sub

Private Sub menufish_Click()


Fish_form.Show

End Sub
Private Sub menufish1_Click()
Fish_form.Command1.Visible = False
Fish_form.Frame1.Visible = True
Fish_form.Show
End Sub

Private Sub menuHamster_Click()


Hamster_form.Show
End Sub

Private Sub menuHamster1_Click()


Hamster_form.Command1.Visible = False
Hamster_form.Frame1.Visible = True
Hamster_form.Show
End Sub

Private Sub Menuhedgehog_Click()


Hedgehog_form.Show
End Sub

Private Sub Menuhedgehog1_Click()


Hedgehog_form.Command1.Visible = False
Hedgehog_form.Frame1.Visible = True
Hedgehog_form.Show
End Sub

Private Sub MenuPetFOod_Click()


PetFood_form.Show
End Sub

Private Sub menuRabbit_Click()


Rabbit_form.Show
End Sub

Private Sub menuRabbit1_Click()


Rabbit_form.Command1.Visible = False
Rabbit_form.Frame1.Visible = True

PETSHOP INVENTORY SYSTEM Page 19


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Rabbit_form.Show
End Sub

Private Sub MenuSoldCages_Click()


SOLDCAGE.Show
End Sub

Private Sub MenuSoldPet_Click()

SOLD.Show
End Sub

Private Sub MenuSoldPetFood_Click()


SOLDFOOD.Show
End Sub

Private Sub menuYes_Click()


define = MsgBox("DO YOU WANT TO CLOSE THE PROGRAM?", vbYesNo)
If define = vbYes Then
End
Else
Form1.Show
Unload Me
End If
End Sub

PETSHOP INVENTORY SYSTEM Page 20


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

BIRD_FORM
Private Sub Command1_Click()
If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select count(code) as cnt from Bird_Table where code like '" & Text1.Text & "'", Cn, 1, 4

BirdPrinting.Show
If Trim(Text1.Text) <> "" Then
If DataEnvironment1.rsBirdCommand.State = adStateOpen Then
DataEnvironment1.rsBirdCommand.Close
DataEnvironment1.BirdCommand Text1.Text & "%"

BirdPrinting.Show
End If

Cn.Execute "INSERT into sold_table(Code,Breed,Color,Gender,Age,PetFood,Cage,DateRcv,Birthday,


Vaccine1,Vaccine2,Vaccine3,Vaccine4,Vaccine5,Medicine,Price,BuyDate,Picture)
values('" & Text1.Text & "','" & Text2.Text & "','" & Text3.Text & "','" & Text4.Text & "','" &
Text5.Text & "','" & Text6.Text & "','" & Text7.Text & "','" & Text8.Text & "','" & Text9.Text & "','"
& lbl_vaccine.Caption & "','" & lbl_vaccine.Caption & "','" & lbl_vaccine.Caption & "','" &
lbl_vaccine.Caption & "','" & lbl_vaccine.Caption & "','" & text10.Text & "','" & Text11.Text & "','"
& lbl_date.Caption & "','" & path.Caption & "') "

Cn.Execute "DELETE from Bird_table where code like '" & Text1.Text & "' "
MsgBox "THANK YOU FOR BUYING!", vbOKOnly, ":)"
End Sub

Private Sub Command2_Click()

If Cn.State = 1 Then Cn.Close


conndb
Rs.Open "select * from Bird_table where Code like '" & Text1.Text & "'", Cn, 1, 4

If Rs!Code<> Text1.Text Or Text1.Text = "" Then


MsgBox "Code not found", vbOKOnly, "SYSTEM"

Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""

PETSHOP INVENTORY SYSTEM Page 21


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Text8.Text = ""
Text9.Text = ""
text10.Text = ""
Text11.Text = ""
path.Caption = "D:\Pet Shop\2x2.jpg"
Picture1.Picture = LoadPicture("D:\Pet Shop\2x2.jpg")

Command1.Enabled = False
Command3.Enabled = False
Command4.Enabled = False
Command5.Enabled = False
Else
Text2.Text = Rs!Breed
Text3.Text = Rs!Color
Text4.Text = Rs!Gender
Text5.Text = Rs!AGE
Text6.Text = Rs!PetFood
Text7.Text = Rs!Cage
Text8.Text = Rs!dateRcv
Text9.Text = Rs!Birthday
text10.Text = Rs!Medicine
Text11.Text = Rs!Price
path.Caption = Rs!Picture
Picture1.Picture = LoadPicture(Rs!Picture)

Command1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Text6.Enabled = True
Text7.Enabled = True
Text8.Enabled = True
Text9.Enabled = True
text10.Enabled = True
Text11.Enabled = True
Picture1.Enabled = True
End If
End Sub

Private Sub Command3_Click()


If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Or Text5.Text = "" Or Text6.Text
= "" Or Text7.Text = "" Or Text8.Text = "" Or Text9.Text = "" Or text10.Text = "" Or Text11.Text = "" Then
MsgBox "FILL UP ALL INFO", vbOKOnly, "SYSTEM"

PETSHOP INVENTORY SYSTEM Page 22


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Else
If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select count(code) as cnt from Bird_Table where code like '" & Text1.Text & "'", Cn, 1, 4

If Rs!cnt> 0 Then
MsgBox "PET CODE ALREADY EXIST!", vbOKOnly, "SYSTEM"
Text1.SetFocus
Rs.Close
Cn.Close

Else
Cn.Execute "INSERT into
Bird_table(Code,Breed,Color,Gender,Age,PetFood,Cage,DateRcv,Birthday,Medicine,Price,Picture)
values('" & Text1.Text & "','" & Text2.Text & "','" & Text3.Text & "','" & Text4.Text & "','" & Text5.Text &
"','" & Text6.Text & "','" & Text7.Text & "','" & Text8.Text & "','" & Text9.Text & "', '" & text10.Text & "','"
& Text11.Text & "','" & path.Caption & "') "
MsgBox "SAVE SUCCESSFUL"
End If
End If
End Sub

Private Sub Command4_Click()


If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Or Text5.Text = "" Or Text6.Text
= "" Then
MsgBox "FILL UP ALL INFO", vbOKOnly, "SYSTEM"

Else

If Cn.State = 1 Then Cn.Close


conndb
Rs.Open "select count(code) as cnt from Bird_table where code like '" & Text1.Text & "'", Cn, 1, 4

If Rs!cnt = 0 Then
MsgBox "PET CODE IS NOT VALID!", vbOKOnly, "SYSTEM"

Else

Cn.Execute "UPDATE Bird_table set Breed = '" & Text2.Text & "',Color ='" & Text3.Text & "',Gender ='" &
Text4.Text & "',Age='" & Text5.Text & "',PetFood ='" & Text6.Text & "',Cage ='" & Text7.Text &
"',DateRcv ='" & Text8.Text & "',Birthday ='" & Text9.Text & "',Medicine ='" & text10.Text & "',Price='" &
Text11.Text & "', Picture= '" & path.Caption & "' where CODE like '" & Text1.Text & "'"
MsgBox "RECORD UPDATED", vbOKOnly, "SYSTEM"

PETSHOP INVENTORY SYSTEM Page 23


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

End If
End If
End Sub

Private Sub Command5_Click()


If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select count(code) as cnt from Bird_table where code like '" & Text1.Text & "'", Cn, 1, 4

If Rs!cnt = 0 Then
MsgBox "PET CODE IS NOT VALID!", vbOKOnly, "SYSTEM"

Rs.Close
Cn.Close
Exit Sub
End If

define = MsgBox("DELETE THIS RECORD?", vbYesNo)

If define = vbYes Then

Cn.Execute "Delete from Bird_table where Code like '" & Text1.Text & "'"
MsgBox "RECORD DELETED", vbOKOnly

End If

End Sub

Private Sub Command6_Click()


Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
text10.Text = ""
Text11.Text = ""
path.Caption = "D:\Pet Shop\2x2.jpg"
Picture1.Picture = LoadPicture("D:\Pet Shop\2x2.jpg")

Text1.Enabled = True

PETSHOP INVENTORY SYSTEM Page 24


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Text6.Enabled = True
Text7.Enabled = True
Text8.Enabled = True
Text9.Enabled = True
text10.Enabled = True
Text11.Enabled = True
Picture1.Enabled = True

Command3.Enabled = True
Command4.Enabled = True
Command5.Enabled = True
End Sub

Private Sub Form_Load()

If Cn.State = 1 Then Cn.Close


conndb
Rs.Open "select * from bird_table ORDER by Code Asc", Cn, 1, 4
Set MSHFlexGrid1.DataSource = Rs

With Me.MSHFlexGrid1
.ColWidth(0) = 1400
.ColWidth(1) = 4000
.ColWidth(2) = 2200
.ColWidth(3) = 2200
.ColWidth(4) = 2200
.ColWidth(5) = 0
.ColWidth(6) = 0
.ColWidth(7) = 0
.ColWidth(8) = 0
.ColWidth(9) = 0
.ColWidth(10) = 0
.ColWidth(11) = 0
.ColWidth(12) = 0
.ColWidth(13) = 0
.ColWidth(14) = 0
.ColWidth(15) = 2200

.Row = 0
.Text = "CODE"

PETSHOP INVENTORY SYSTEM Page 25


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

.Col = 1
.Text = "BREED"
.Col = 2
.Text = "COLOR"
.Col = 3
.Text = "GENDER"
.Col = 4
.Text = "SIZE"
.Col = 5
.Text = "PRICE"

End With
Rs.Close
Cn.Close
End Sub
Private Sub Picture1_Click()
dlg.Filter = "JPEG Photo (*jpg)|*.jpg|Bitmap File (*.bmp)|*.bmp"
dlg.FilterIndex = 1
dlg.CancelError = True
On Error Resume Next
dlg.ShowOpen
If Err.Number = cdlCancel Then
Exit Sub
Else
If Err.Number <> 0 Then
MsgBox "Error "& Format$(Err.Number) & _
" selecting file." & vbCrLf & _
Err.Description
Exit Sub
End If

On Error GoTo 0
path.Caption = dlg.FileName
Picture1.Visible = True
Picture1.Picture = LoadPicture(dlg.FileName)
End If
End Sub

Private Sub Timer1_Timer()


lbl_date.Caption = Format(Now, "MMMM dd,yyyy")
End Sub

PETSHOP INVENTORY SYSTEM Page 26


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

CAT_FORM
Private Sub Command1_Click()
If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select count(code) as cnt from Cat_table where code like '" & Text1.Text & "'", Cn, 1, 4

CatPrinting.Show
If Trim(Text1.Text) <> "" Then
If DataEnvironment1.rsCatcommand.State = adStateOpen Then DataEnvironment1.rsCatcommand.Close
DataEnvironment1.CatCommand Text1.Text & "%"

CatPrinting.Show
End If

Cn.Execute "INSERT into


sold_table(Code,Breed,Color,Gender,Age,PetFood,Cage,DateRcv,Birthday,Vaccine1,Vaccine2,Vaccine3,V
accine4,Vaccine5,Medicine,Price,BuyDate,Picture) values('" & Text1.Text & "','" & Text2.Text & "','" &
Text3.Text & "','" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text & "','" & Text7.Text & "','" &
Text8.Text & "','" & Text9.Text & "', '" & Combo1.Text & "', '" & Combo2.Text & "', '" & Combo3.Text & "',
'" & Combo4.Text & "', '" & Combo5.Text & "','" & text10.Text & "','" & Text11.Text & "','" &
lbl_date.Caption & "','" & path.Caption & "') "

Cn.Execute "DELETE from Cat_table where code like '" & Text1.Text & "' "

MsgBox "THANK YOU FOR BUYING!", vbOKOnly, ":)"


Command6_Click
End Sub

Private Sub Command2_Click()

If Cn.State = 1 Then Cn.Close


conndb
Rs.Open "select * from Cat_table where Code like '" & Text1.Text & "'", Cn, 1, 4

If Rs!Code<> Text1.Text Or Text1.Text = "" Then


MsgBox "Code not found", vbOKOnly, "SYSTEM"

Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""

PETSHOP INVENTORY SYSTEM Page 27


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
text10.Text = ""
Text11.Text = ""
Combo1.Text = ""
Combo2.Text = ""
Combo3.Text = ""
Combo4.Text = ""
path.Caption = "D:\Pet Shop\2x2.jpg"
Picture1.Picture = LoadPicture("D:\Pet Shop\2x2.jpg")

Command1.Enabled = False
Command3.Enabled = False
Command4.Enabled = False
Command5.Enabled = False

Else

Text2.Text = Rs!Breed
Text3.Text = Rs!Color
Text4.Text = Rs!Gender
Text5.Text = Rs!AGE
Text6.Text = Rs!PetFood
Text7.Text = Rs!Cage
Text8.Text = Rs!dateRcv
Text9.Text = Rs!Birthday
text10.Text = Rs!Medicine
Text11.Text = Rs!Price
Combo1.Text = Rs!vaccine1
Combo2.Text = Rs!vaccine2
Combo3.Text = Rs!vaccine3
Combo4.Text = Rs!vaccine4
Combo5.Text = Rs!vaccine5
path.Caption = Rs!Picture
Picture1.Picture = LoadPicture(Rs!Picture)

Command1.Enabled = True

Text2.Enabled = True
Text3.Enabled = True

PETSHOP INVENTORY SYSTEM Page 28


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Text4.Enabled = True
Text5.Enabled = True
Text6.Enabled = True
Text7.Enabled = True
Text8.Enabled = True
Text9.Enabled = True
text10.Enabled = True
Text11.Enabled = True
Combo1.Enabled = True
Combo2.Enabled = True
Combo3.Enabled = True
Combo4.Enabled = True
Combo5.Enabled = True

Picture1.Enabled = True

End If
End Sub

Private Sub Command3_Click()


If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Or Text5.Text = "" Or Text6.Text
= "" Or Text7.Text = "" Or Text8.Text = "" Or Text9.Text = "" Or text10.Text = "" Or Text11.Text = "" Then
MsgBox "FILL UP ALL INFO", vbOKOnly, "SYSTEM"

Else
If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select count(code) as cnt from Cat_table where code like '" & Text1.Text & "'", Cn, 1, 4

If Rs!cnt> 0 Then
MsgBox "PET CODE ALREADY EXIST!", vbOKOnly, "SYSTEM"
Text1.SetFocus
Rs.Close
Cn.Close
Else
Cn.Execute "INSERT into
Cat_table(Code,Breed,Color,Gender,Age,PetFood,Cage,DateRcv,Birthday,Vaccine1,Vaccine2,Vaccine3,V
accine4,Vaccine5,Medicine,Price,Picture) values('" & Text1.Text & "','" & Text2.Text & "','" & Text3.Text
& "','" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text & "','" & Text7.Text & "','" & Text8.Text & "','"
& Text9.Text & "', '" & Combo1.Text & "', '" & Combo2.Text & "', '" & Combo3.Text & "', '" &
Combo4.Text & "', '" & Combo5.Text & "','" & text10.Text & "','" & Text11.Text & "','" & path.Caption &
"') "
MsgBox "SAVE SUCCESSFUL"
End If

PETSHOP INVENTORY SYSTEM Page 29


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

End If
End Sub

Private Sub Command4_Click()


If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Or Text5.Text = "" Or Text6.Text
= "" Then
MsgBox "FILL UP ALL INFO", vbOKOnly, "SYSTEM"

Else
If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select count(code) as cnt from Cat_table where code like '" & Text1.Text & "'", Cn, 1, 4

If Rs!cnt = 0 Then
MsgBox "PET CODE IS NOT VALID!", vbOKOnly, "SYSTEM"

Else

Cn.Execute "UPDATE Cat_table set Breed = '" & Text2.Text & "',Color ='" & Text3.Text & "',Gender ='" &
Text4.Text & "',Age='" & Text5.Text & "',PetFood ='" & Text6.Text & "',Cage ='" & Text7.Text &
"',DateRcv ='" & Text8.Text & "',Birthday ='" & Text9.Text & "',Vaccine1 ='" & Combo1.Text &
"',Vaccine2='" & Combo2.Text & "',Vaccine3='" & Combo3.Text & "',Vaccine4='" & Combo4.Text &
"',Vaccine5 ='" & Text5.Text & "',Medicine ='" & text10.Text & "',Price='" & Text11.Text & "', Picture = '"
& path.Caption & "' where CODE like '" & Text1.Text & "'"
MsgBox "RECORD UPDATED", vbOKOnly, "SYSTEM"

End If
End If
End Sub

Private Sub Command5_Click()


If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select count(code) as cnt from Cat_table where code like '" & Text1.Text & "'", Cn, 1, 4

If Rs!cnt = 0 Then
MsgBox "PET CODE IS NOT VALID!", vbOKOnly, "SYSTEM"

Rs.Close
Cn.Close
Exit Sub
End If

define = MsgBox("DELETE THIS RECORD?", vbYesNo)

PETSHOP INVENTORY SYSTEM Page 30


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

If define = vbYes Then

Cn.Execute "Delete from Cat_table where Code like '" & Text1.Text & "'"
MsgBox "RECORD DELETED", vbOKOnly

End If

End Sub

Private Sub Command6_Click()


Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
text10.Text = ""
Text11.Text = ""
Combo1.Text = ""
Combo2.Text = ""
Combo3.Text = ""
Combo4.Text = ""
Combo5.Text = ""
path.Caption = "D:\Pet Shop\2x2.jpg"
Picture1.Picture = LoadPicture("D:\Pet Shop\2x2.jpg")

Text1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Text6.Enabled = True
Text7.Enabled = True
Text8.Enabled = True
Text9.Enabled = True
text10.Enabled = True
Text11.Enabled = True
Combo1.Enabled = True
Combo2.Enabled = True
Combo3.Enabled = True
Combo4.Enabled = True

PETSHOP INVENTORY SYSTEM Page 31


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Combo5.Enabled = True
Picture1.Enabled = True

End Sub

Private Sub Form_Load()

If Cn.State = 1 Then Cn.Close


conndb
Rs.Open "select * from Cat_table ORDER by Code Asc", Cn, 1, 4
Set MSHFlexGrid1.DataSource = Rs

With Me.MSHFlexGrid1
.ColWidth(0) = 1400
.ColWidth(1) = 4000
.ColWidth(2) = 2200
.ColWidth(3) = 2200
.ColWidth(4) = 2200
.ColWidth(5) = 0
.ColWidth(6) = 0
.ColWidth(7) = 0
.ColWidth(8) = 0
.ColWidth(9) = 0
.ColWidth(10) = 0
.ColWidth(11) = 0
.ColWidth(12) = 0
.ColWidth(13) = 0
.ColWidth(14) = 0
.ColWidth(15) = 2200

.Row = 0
.Text = "CODE"
.Col = 1
.Text = "BREED"
.Col = 2
.Text = "COLOR"
.Col = 3
.Text = "GENDER"
.Col = 4
.Text = "SIZE"
.Col = 5
.Text = "PRICE"

End With

PETSHOP INVENTORY SYSTEM Page 32


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Rs.Close
Cn.Close
End Sub

Private Sub Picture1_Click()


dlg.Filter = "JPEG Photo (*jpg)|*.jpg|Bitmap File (*.bmp)|*.bmp"
dlg.FilterIndex = 1
dlg.CancelError = True
On Error Resume Next
dlg.ShowOpen
If Err.Number = cdlCancel Then
Exit Sub
Else
If Err.Number <> 0 Then
MsgBox "Error "& Format$(Err.Number) & _
" selecting file." & vbCrLf & _
Err.Description
Exit Sub
End If

On Error GoTo 0
path.Caption = dlg.FileName
Picture1.Visible = True
Picture1.Picture = LoadPicture(dlg.FileName)
End If
End Sub

Private Sub Timer1_Timer()


lbl_date.Caption = Format(Now, "MMMM dd,yyyy")
End Sub

PETSHOP INVENTORY SYSTEM Page 33


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

DOG_FORM
Private Sub Command1_Click()
If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select count(code) as cnt from Dog_table where code like '" & Text1.Text & "'", Cn, 1, 4

DogPrinting.Show
If Trim(Text1.Text) <> "" Then
If DataEnvironment1.rsDogCommand.State = adStateOpen Then
DataEnvironment1.rsDogCommand.Close
DataEnvironment1.DogCommand Text1.Text & "%"

DogPrinting.Show
End If

Cn.Execute "INSERT into


sold_table(Code,Breed,Color,Gender,Age,PetFood,Cage,DateRcv,Birthday,Vaccine1,Vaccine2,Vaccine3,V
accine4,Vaccine5,Medicine,Price,BuyDate,Picture) values('" & Text1.Text & "','" & Text2.Text & "','" &
Text3.Text & "','" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text & "','" & Text7.Text & "','" &
Text8.Text & "','" & Text9.Text & "', '" & Combo1.Text & "', '" & Combo2.Text & "', '" & Combo3.Text & "',
'" & Combo4.Text & "', '" & Combo5.Text & "','" & text10.Text & "','" & Text11.Text & "','" &
lbl_date.Caption & "','" & path.Caption & "') "

Cn.Execute "DELETE from Dog_table where code like '" & Text1.Text & "' "

MsgBox "THANK YOU FOR BUYING!", vbOKOnly, ":)"


End Sub

Private Sub Command2_Click()


If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select * from Dog_table where Code like '" & Text1.Text & "'", Cn, 1, 4

If Rs!Code<> Text1.Text Or Text1.Text = "" Then


MsgBox "Code not found", vbOKOnly, "SYSTEM"

Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""

PETSHOP INVENTORY SYSTEM Page 34


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Text9.Text = ""
text10.Text = ""
Text11.Text = ""
Combo1.Text = ""
Combo2.Text = ""
Combo3.Text = ""
Combo4.Text = ""
path.Caption = "D:\Pet Shop\2x2.jpg"
Picture1.Picture = LoadPicture("D:\Pet Shop\2x2.jpg")

Command1.Enabled = False
Command3.Enabled = False
Command4.Enabled = False
Command5.Enabled = False
Picture1.Enabled = False

Else
Text2.Text = Rs!Breed
Text3.Text = Rs!Color
Text4.Text = Rs!Gender
Text5.Text = Rs!AGE
Text6.Text = Rs!PetFood
Text7.Text = Rs!Cage
Text8.Text = Rs!dateRcv
Text9.Text = Rs!Birthday
text10.Text = Rs!Medicine
Text11.Text = Rs!Price
Combo1.Text = Rs!vaccine1
Combo2.Text = Rs!vaccine2
Combo3.Text = Rs!vaccine3
Combo4.Text = Rs!vaccine4
Combo5.Text = Rs!vaccine5
path.Caption = Rs!Picture
Picture1.Picture = LoadPicture(Rs!Picture)

Command1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Text6.Enabled = True
Text7.Enabled = True
Text8.Enabled = True
Text9.Enabled = True

PETSHOP INVENTORY SYSTEM Page 35


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

text10.Enabled = True
Text11.Enabled = True
Combo1.Enabled = True
Combo2.Enabled = True
Combo3.Enabled = True
Combo4.Enabled = True
Combo5.Enabled = True
Picture1.Enabled = True
End If

End Sub

Private Sub Command3_Click()


If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Or Text5.Text = "" Or Text6.Text
= "" Or Text7.Text = "" Or Text8.Text = "" Or Text9.Text = "" Or text10.Text = "" Or Text11.Text = "" Then
MsgBox "FILL UP ALL INFO", vbOKOnly, "SYSTEM"

Else
If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select count(code) as cnt from Dog_table where code like '" & Text1.Text & "'", Cn, 1, 4

If Rs!cnt> 0 Then
MsgBox "PET CODE ALREADY EXIST!", vbOKOnly, "SYSTEM"
Text1.SetFocus
Rs.Close
Cn.Close
Else
Cn.Execute "INSERT into
Dog_table(Code,Breed,Color,Gender,Age,PetFood,Cage,DateRcv,Birthday,Vaccine1,Vaccine2,Vaccine3,V
accine4,Vaccine5,Medicine,Price,Picture) values('" & Text1.Text & "','" & Text2.Text & "','" & Text3.Text
& "','" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text & "','" & Text7.Text & "','" & Text8.Text & "','"
& Text9.Text & "', '" & Combo1.Text & "', '" & Combo2.Text & "', '" & Combo3.Text & "', '" &
Combo4.Text & "', '" & Combo5.Text & "','" & text10.Text & "','" & Text11.Text & "','" & path.Caption &
"') "
MsgBox "SAVE SUCCESSFUL"
End If
End If
End Sub

Private Sub Command4_Click()


If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Or Text5.Text = "" Or Text6.Text
= "" Then
MsgBox "FILL UP ALL INFO", vbOKOnly, "SYSTEM"

PETSHOP INVENTORY SYSTEM Page 36


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Else
If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select count(code) as cnt from Dog_table where code like '" & Text1.Text & "'", Cn, 1, 4

If Rs!cnt = 0 Then
MsgBox "PET CODE IS NOT VALID!", vbOKOnly, "SYSTEM"
Else

Cn.Execute "UPDATE Dog_table set Breed = '" & Text2.Text & "',Color ='" & Text3.Text & "',Gender ='" &
Text4.Text & "',Age='" & Text5.Text & "',PetFood ='" & Text6.Text & "',Cage ='" & Text7.Text &
"',DateRcv ='" & Text8.Text & "',Birthday ='" & Text9.Text & "',Vaccine1 ='" & Combo1.Text &
"',Vaccine2='" & Combo2.Text & "',Vaccine3='" & Combo3.Text & "',Vaccine4='" & Combo4.Text &
"',Vaccine5 ='" & Text5.Text & "',Medicine ='" & text10.Text & "',Price='" & Text11.Text & "', Picture = '"
& path.Caption & "' where CODE like '" & Text1.Text & "'"
MsgBox "RECORD UPDATED", vbOKOnly, "SYSTEM"

End If
End If
End Sub

Private Sub Command5_Click()


If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select count(code) as cnt from Dog_table where code like '" & Text1.Text & "'", Cn, 1, 4

If Rs!cnt = 0 Then
MsgBox "PET CODE IS NOT VALID!", vbOKOnly, "SYSTEM"

Rs.Close
Cn.Close
Exit Sub
End If

define = MsgBox("DELETE THIS RECORD?", vbYesNo)

If define = vbYes Then

Cn.Execute "Delete from Dog_table where Code like '" & Text1.Text & "'"
MsgBox "RECORD DELETED", vbOKOnly
End If
End Sub

Private Sub Command6_Click()

PETSHOP INVENTORY SYSTEM Page 37


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
text10.Text = ""
Text11.Text = ""
Combo1.Text = ""
Combo2.Text = ""
Combo3.Text = ""
Combo4.Text = ""
Combo5.Text = ""
Picture1.Picture = LoadPicture("D:\Pet Shop\2x2.jpg")

Text1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Text6.Enabled = True
Text7.Enabled = True
Text8.Enabled = True
Text9.Enabled = True
text10.Enabled = True
Text11.Enabled = True
Combo1.Enabled = True
Combo2.Enabled = True
Combo3.Enabled = True
Combo4.Enabled = True
Combo5.Enabled = True
Picture1.Enabled = True
End Sub

Private Sub Form_Load()

If Cn.State = 1 Then Cn.Close


conndb
Rs.Open "select * from Dog_table ORDER by Code Asc", Cn, 1, 4
Set MSHFlexGrid1.DataSource = Rs

PETSHOP INVENTORY SYSTEM Page 38


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

With Me.MSHFlexGrid1
.ColWidth(0) = 1400
.ColWidth(1) = 4000
.ColWidth(2) = 2200
.ColWidth(3) = 2200
.ColWidth(4) = 2200
.ColWidth(5) = 0
.ColWidth(6) = 0
.ColWidth(7) = 0
.ColWidth(8) = 0
.ColWidth(9) = 0
.ColWidth(10) = 0
.ColWidth(11) = 0
.ColWidth(12) = 0
.ColWidth(13) = 0
.ColWidth(14) = 0
.ColWidth(15) = 2200

.Row = 0
.Text = "CODE"
.Col = 1
.Text = "BREED"
.Col = 2
.Text = "COLOR"
.Col = 3
.Text = "GENDER"
.Col = 4
.Text = "SIZE"
.Col = 5
.Text = "PRICE"

End With
Rs.Close
Cn.Close
End Sub

Private Sub Picture1_Click()


dlg.Filter = "JPEG Photo (*jpg)|*.jpg|Bitmap File (*.bmp)|*.bmp"
dlg.FilterIndex = 1
dlg.CancelError = True
On Error Resume Next
dlg.ShowOpen
If Err.Number = cdlCancel Then
Exit Sub

PETSHOP INVENTORY SYSTEM Page 39


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Else
If Err.Number <> 0 Then
MsgBox "Error "& Format$(Err.Number) & _
" selecting file." & vbCrLf & _
Err.Description
Exit Sub
End If

On Error GoTo 0
path.Caption = dlg.FileName
Picture1.Visible = True
Picture1.Picture = LoadPicture(dlg.FileName)
End If
End Sub

Private Sub Timer1_Timer()


lbl_date.Caption = Format(Now, "MMMM dd,yyyy")
End Sub

PETSHOP INVENTORY SYSTEM Page 40


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

FISH_FORM
Private Sub Command1_Click()
If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select count(code) as cnt from Fish_Table where code like '" & Text1.Text & "'", Cn, 1, 4

FishPrinting.Show
If Trim(Text1.Text) <> "" Then
If DataEnvironment1.rsFishCommand.State = adStateOpen Then
DataEnvironment1.rsFishCommand.Close
DataEnvironment1.FishCommand Text1.Text & "%"
FishPrinting.Show
End If

Cn.Execute "INSERT into


sold_table(Code,Breed,Color,Gender,Age,PetFood,Cage,DateRcv,Birthday,Vaccine1,Vaccine2,Vaccine3,V
accine4,Vaccine5,Medicine,Price,BuyDate,Picture) values('" & Text1.Text & "','" & Text2.Text & "','" &
Text3.Text & "','" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text & "','" & Text7.Text & "','" &
Text8.Text & "','" & Text9.Text & "','" & lbl_vaccine.Caption & "','" & lbl_vaccine.Caption & "','" &
lbl_vaccine.Caption & "','" & lbl_vaccine.Caption & "','" & lbl_vaccine.Caption & "','" & text10.Text & "','"
& Text11.Text & "','" & lbl_date.Caption & "','" & path.Caption & "') "

Cn.Execute "DELETE from Fish_table where code like '" & Text1.Text & "' "

MsgBox "THANK YOU FOR BUYING!", vbOKOnly, ":)"


Command6_Click
End Sub

Private Sub Command2_Click()

If Cn.State = 1 Then Cn.Close


conndb
Rs.Open "select * from Fish_table where Code like '" & Text1.Text & "'", Cn, 1, 4

If Rs!Code<> Text1.Text Or Text1.Text = "" Then


MsgBox "Code not found", vbOKOnly, "SYSTEM"

Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""

PETSHOP INVENTORY SYSTEM Page 41


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Text8.Text = ""
Text9.Text = ""
text10.Text = ""
Text11.Text = ""
path.Caption = "D:\Pet Shop\2x2.jpg"
Picture1.Picture = LoadPicture("D:\Pet Shop\2x2.jpg")

Command1.Enabled = False
Command3.Enabled = False
Command4.Enabled = False
Command5.Enabled = False
Picture1.Enabled = False

Else
Text2.Text = Rs!Breed
Text3.Text = Rs!Color
Text4.Text = Rs!Gender
Text5.Text = Rs!AGE
Text6.Text = Rs!PetFood
Text7.Text = Rs!Cage
Text8.Text = Rs!dateRcv
Text9.Text = Rs!Birthday
text10.Text = Rs!Medicine
Text11.Text = Rs!Price
path.Caption = Rs!Picture
Picture1.Picture = LoadPicture(Rs!Picture)

Command1.Enabled = True

Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Text6.Enabled = True
Text7.Enabled = True
Text8.Enabled = True
Text9.Enabled = True
text10.Enabled = True
Text11.Enabled = True
Picture1.Enabled = True
End If
End Sub

Private Sub Command3_Click()

PETSHOP INVENTORY SYSTEM Page 42


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Or Text5.Text = "" Or Text6.Text
= "" Or Text7.Text = "" Or Text8.Text = "" Or Text9.Text = "" Or text10.Text = "" Or Text11.Text = "" Then
MsgBox "FILL UP ALL INFO", vbOKOnly, "SYSTEM"

Else

If Cn.State = 1 Then Cn.Close


conndb
Rs.Open "select count(code) as cnt from Fish_Table where code like '" & Text1.Text & "'", Cn, 1, 4

If Rs!cnt> 0 Then
MsgBox "PET CODE ALREADY EXIST!", vbOKOnly, "SYSTEM"
Text1.SetFocus
Rs.Close
Cn.Close
Else
Cn.Execute "INSERT into
Fish_table(Code,Breed,Color,Gender,Age,PetFood,Cage,DateRcv,Birthday,Medicine,Price,Picture)
values('" & Text1.Text & "','" & Text2.Text & "','" & Text3.Text & "','" & Text4.Text & "','" & Text5.Text &
"','" & Text6.Text & "','" & Text7.Text & "','" & Text8.Text & "','" & Text9.Text & "', '" & text10.Text & "','"
& Text11.Text & "','" & path.Caption & "') "
MsgBox "SAVE SUCCESSFUL"
End If
End If
End Sub

Private Sub Command4_Click()


If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Or Text5.Text = "" Or Text6.Text
= "" Then
MsgBox "FILL UP ALL INFO", vbOKOnly, "SYSTEM"

Else
If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select count(code) as cnt from Fish_table where code like '" & Text1.Text & "'", Cn, 1, 4

If Rs!cnt = 0 Then
MsgBox "PET CODE IS NOT VALID!", vbOKOnly, "SYSTEM"

Else

Cn.Execute "UPDATE Fish_table set Breed = '" & Text2.Text & "',Color ='" & Text3.Text & "',Gender ='" &
Text4.Text & "',Age='" & Text5.Text & "',PetFood ='" & Text6.Text & "',Cage ='" & Text7.Text &

PETSHOP INVENTORY SYSTEM Page 43


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

"',DateRcv ='" & Text8.Text & "',Birthday ='" & Text9.Text & "',Medicine ='" & text10.Text & "',Price='" &
Text11.Text & "', Picture = '" & path.Caption & "' where CODE like '" & Text1.Text & "'"
MsgBox "RECORD UPDATED", vbOKOnly, "SYSTEM"

End If
End If
End Sub

Private Sub Command5_Click()


If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select count(code) as cnt from Fish_table where code like '" & Text1.Text & "'", Cn, 1, 4

If Rs!cnt = 0 Then
MsgBox "PET CODE IS NOT VALID!", vbOKOnly, "SYSTEM"
Rs.Close
Cn.Close
Exit Sub
End If

define = MsgBox("DELETE THIS RECORD?", vbYesNo)


If define = vbYes Then

Cn.Execute "Delete from Fish_table where Code like '" & Text1.Text & "'"
MsgBox "RECORD DELETED", vbOKOnly

End If
End Sub

Private Sub Command6_Click()


Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
text10.Text = ""
Text11.Text = ""
path.Caption = "D:\Pet Shop\2x2.jpg"
Picture1.Picture = LoadPicture("D:\Pet Shop\2x2.jpg")

Text1.Enabled = True

PETSHOP INVENTORY SYSTEM Page 44


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Text6.Enabled = True
Text7.Enabled = True
Text8.Enabled = True
Text9.Enabled = True
text10.Enabled = True
Text11.Enabled = True
Picture1.Enabled = True

End Sub
Private Sub Form_Load()

If Cn.State = 1 Then Cn.Close


conndb
Rs.Open "select * from Fish_table ORDER by Code Asc", Cn, 1, 4
Set MSHFlexGrid1.DataSource = Rs

With Me.MSHFlexGrid1
.ColWidth(0) = 1400
.ColWidth(1) = 4000
.ColWidth(2) = 2200
.ColWidth(3) = 2200
.ColWidth(4) = 2200
.ColWidth(5) = 0
.ColWidth(6) = 0
.ColWidth(7) = 0
.ColWidth(8) = 0
.ColWidth(9) = 0
.ColWidth(10) = 0
.ColWidth(11) = 0
.ColWidth(12) = 0
.ColWidth(13) = 0
.ColWidth(14) = 0
.ColWidth(15) = 2200

.Row = 0
.Text = "CODE"
.Col = 1
.Text = "BREED"
.Col = 2
.Text = "COLOR"

PETSHOP INVENTORY SYSTEM Page 45


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

.Col = 3
.Text = "GENDER"
.Col = 4
.Text = "SIZE"
.Col = 5
.Text = "PRICE"

End With
Rs.Close
Cn.Close
End Sub

Private Sub Picture1_Click()


dlg.Filter = "JPEG Photo (*jpg)|*.jpg|Bitmap File (*.bmp)|*.bmp"
dlg.FilterIndex = 1
dlg.CancelError = True
On Error Resume Next
dlg.ShowOpen
If Err.Number = cdlCancel Then
Exit Sub
Else
If Err.Number <> 0 Then
MsgBox "Error "& Format$(Err.Number) & _
" selecting file." & vbCrLf & _
Err.Description
Exit Sub
End If

On Error GoTo 0
path.Caption = dlg.FileName
Picture1.Visible = True
Picture1.Picture = LoadPicture(dlg.FileName)
End If
End Sub

Private Sub Timer1_Timer()


lbl_date.Caption = Format(Now, "MMMM dd,yyyy")
End Sub

PETSHOP INVENTORY SYSTEM Page 46


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

HAMSTER_FORM

Private Sub Command1_Click()


If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select count(code) as cnt from Hamster_Table where code like '" & Text1.Text & "'", Cn, 1, 4

HamsterPrinting.Show
If Trim(Text1.Text) <> "" Then
If DataEnvironment1.rsHamsterCommand.State = adStateOpen Then
DataEnvironment1.rsHamsterCommand.Close
DataEnvironment1.HamsterCommand Text1.Text & "%"

HamsterPrinting.Show
End If

Cn.Execute "INSERT into


sold_table(Code,Breed,Color,Gender,Age,PetFood,Cage,DateRcv,Birthday,Vaccine1,Vaccine2,Vaccine3,V
accine4,Vaccine5,Medicine,Price,BuyDate,Picture) values('" & Text1.Text & "','" & Text2.Text & "','" &
Text3.Text & "','" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text & "','" & Text7.Text & "','" &
Text8.Text & "','" & Text9.Text & "','" & lbl_vaccine.Caption & "','" & lbl_vaccine.Caption & "','" &
lbl_vaccine.Caption & "','" & lbl_vaccine.Caption & "','" & lbl_vaccine.Caption & "','" & text10.Text & "','"
& Text11.Text & "','" & lbl_date.Caption & "','" & path.Caption & "') "

Cn.Execute "DELETE from Hamster_table where code like '" & Text1.Text & "' "

MsgBox "THANK YOU FOR BUYING!", vbOKOnly, ":)"


Command6_Click
End Sub

Private Sub Command2_Click()

If Cn.State = 1 Then Cn.Close


conndb
Rs.Open "select * from Hamster_table where Code like '" & Text1.Text & "'", Cn, 1, 4

If Rs!Code<> Text1.Text Or Text1.Text = "" Then


MsgBox "Code not found", vbOKOnly, "SYSTEM"

Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""

PETSHOP INVENTORY SYSTEM Page 47


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
text10.Text = ""
Text11.Text = ""
path.Caption = "D:\Pet Shop\2x2.jpg"
Picture1.Picture = LoadPicture("D:\Pet Shop\2x2.jpg")

Command1.Enabled = False
Command3.Enabled = False
Command4.Enabled = False
Command5.Enabled = False
Picture1.Enabled = False

Else
Text2.Text = Rs!Breed
Text3.Text = Rs!Color
Text4.Text = Rs!Gender
Text5.Text = Rs!AGE
Text6.Text = Rs!PetFood
Text7.Text = Rs!Cage
Text8.Text = Rs!dateRcv
Text9.Text = Rs!Birthday
text10.Text = Rs!Medicine
Text11.Text = Rs!Price
path.Caption = Rs!Picture
Picture1.Picture = LoadPicture(Rs!Picture)

Command1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Text6.Enabled = True
Text7.Enabled = True
Text8.Enabled = True
Text9.Enabled = True
text10.Enabled = True
Text11.Enabled = True
Picture1.Enabled = True
End If
End Sub

PETSHOP INVENTORY SYSTEM Page 48


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Private Sub Command3_Click()


If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Or Text5.Text = "" Or Text6.Text
= "" Or Text7.Text = "" Or Text8.Text = "" Or Text9.Text = "" Or text10.Text = "" Or Text11.Text = "" Then
MsgBox "FILL UP ALL INFO", vbOKOnly, "SYSTEM"

Else

If Cn.State = 1 Then Cn.Close


conndb
Rs.Open "select count(code) as cnt from Hamster_Table where code like '" & Text1.Text & "'", Cn, 1, 4

If Rs!cnt> 0 Then
MsgBox "PET CODE ALREADY EXIST!", vbOKOnly, "SYSTEM"
Text1.SetFocus
Rs.Close
Cn.Close
Else
Cn.Execute "INSERT into
Hamster_table(Code,Breed,Color,Gender,Age,PetFood,Cage,DateRcv,Birthday,Medicine,Price,Picture)
values('" & Text1.Text & "','" & Text2.Text & "','" & Text3.Text & "','" & Text4.Text & "','" & Text5.Text &
"','" & Text6.Text & "','" & Text7.Text & "','" & Text8.Text & "','" & Text9.Text & "', '" & text10.Text & "','"
& Text11.Text & "','" & path.Caption & "') "
MsgBox "SAVE SUCCESSFUL"
End If
End If
End Sub

Private Sub Command4_Click()


If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Or Text5.Text = "" Or Text6.Text
= "" Then
MsgBox "FILL UP ALL INFO", vbOKOnly, "SYSTEM"

Else
If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select count(code) as cnt from Hamster_table where code like '" & Text1.Text & "'", Cn, 1, 4

If Rs!cnt = 0 Then
MsgBox "PET CODE IS NOT VALID!", vbOKOnly, "SYSTEM"

Else
Cn.Execute "UPDATE Hamster_table set Breed = '" & Text2.Text & "',Color ='" & Text3.Text &
"',Gender ='" & Text4.Text & "',Age='" & Text5.Text & "',PetFood ='" & Text6.Text & "',Cage ='" &

PETSHOP INVENTORY SYSTEM Page 49


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Text7.Text & "',DateRcv ='" & Text8.Text & "',Birthday ='" & Text9.Text & "',Medicine ='" &
text10.Text & "',Price='" & Text11.Text & "', Picture = '" & path.Caption & "' where CODE like '" &
Text1.Text & "'"
MsgBox "RECORD UPDATED", vbOKOnly, "SYSTEM"

End If
End If
End Sub

Private Sub Command5_Click()


If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select count(code) as cnt from Hamster_table where code like '" & Text1.Text & "'", Cn, 1, 4

If Rs!cnt = 0 Then
MsgBox "PET CODE IS NOT VALID!", vbOKOnly, "SYSTEM"
Rs.Close
Cn.Close
Exit Sub
End If

define = MsgBox("DELETE THIS RECORD?", vbYesNo)


If define = vbYes Then

Cn.Execute "Delete from Hamster_table where Code like '" & Text1.Text & "'"
MsgBox "RECORD DELETED", vbOKOnly
End If
End Sub

Private Sub Command6_Click()


Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
text10.Text = ""
Text11.Text = ""
path.Caption = ""

PETSHOP INVENTORY SYSTEM Page 50


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Picture1.Picture = LoadPicture("D:\Pet Shop\2x2.jpg")

Text1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Text6.Enabled = True
Text7.Enabled = True
Text8.Enabled = True
Text9.Enabled = True
text10.Enabled = True
Text11.Enabled = True
Picture1.Enabled = True
End Sub
Private Sub Form_Load()

If Cn.State = 1 Then Cn.Close


conndb
Rs.Open "select * from Hamster_table ORDER by Code Asc", Cn, 1, 4
Set MSHFlexGrid1.DataSource = Rs

With Me.MSHFlexGrid1
.ColWidth(0) = 1400
.ColWidth(1) = 4000
.ColWidth(2) = 2200
.ColWidth(3) = 2200
.ColWidth(4) = 2200
.ColWidth(5) = 0
.ColWidth(6) = 0
.ColWidth(7) = 0
.ColWidth(8) = 0
.ColWidth(9) = 0
.ColWidth(10) = 0
.ColWidth(11) = 0
.ColWidth(12) = 0
.ColWidth(13) = 0
.ColWidth(14) = 0
.ColWidth(15) = 2200

.Row = 0
.Text = "CODE"
.Col = 1
.Text = "BREED"

PETSHOP INVENTORY SYSTEM Page 51


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

.Col = 2
.Text = "COLOR"
.Col = 3
.Text = "GENDER"
.Col = 4
.Text = "SIZE"
.Col = 5
.Text = "PRICE"
End With
Rs.Close
Cn.Close
End Sub

Private Sub Picture1_Click()


dlg.Filter = "JPEG Photo (*jpg)|*.jpg|Bitmap File (*.bmp)|*.bmp"
dlg.FilterIndex = 1
dlg.CancelError = True
On Error Resume Next
dlg.ShowOpen
If Err.Number = cdlCancel Then
Exit Sub
Else
If Err.Number <> 0 Then
MsgBox "Error "& Format$(Err.Number) & _
" selecting file." & vbCrLf & _
Err.Description
Exit Sub
End If

On Error GoTo 0
path.Caption = dlg.FileName
Picture1.Visible = True
Picture1.Picture = LoadPicture(dlg.FileName)
End If
End Sub

Private Sub Timer1_Timer()


lbl_date.Caption = Format(Now, "MMMM dd,yyyy")
End Sub

PETSHOP INVENTORY SYSTEM Page 52


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

HEDGEHOG_FORM
Private Sub Command1_Click()
If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select count(code) as cnt from Hedgehog_Table where code like '" & Text1.Text & "'", Cn, 1, 4

HedgehogPrinting.Show
If Trim(Text1.Text) <> "" Then
If DataEnvironment1.rsHedgehogCommand.State = adStateOpen Then
DataEnvironment1.rsHedgehogCommand.Close
DataEnvironment1.HedgehogCommand Text1.Text & "%"

HedgehogPrinting.Show
End If

Cn.Execute "INSERT into


sold_table(Code,Breed,Color,Gender,Age,PetFood,Cage,DateRcv,Birthday,Vaccine1,Vaccine2,Vaccine3,V
accine4,Vaccine5,Medicine,Price,BuyDate,Picture) values('" & Text1.Text & "','" & Text2.Text & "','" &
Text3.Text & "','" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text & "','" & Text7.Text & "','" &
Text8.Text & "','" & Text9.Text & "','" & lbl_vaccine.Caption & "','" & lbl_vaccine.Caption & "','" &
lbl_vaccine.Caption & "','" & lbl_vaccine.Caption & "','" & lbl_vaccine.Caption & "','" & text10.Text & "','"
& Text11.Text & "','" & lbl_date.Caption & "','" & path.Caption & "') "

Cn.Execute "DELETE from Hedgehog_table where code like '" & Text1.Text & "' "

MsgBox "THANK YOU FOR BUYING!", vbOKOnly, ":)"


Command6_Click
End Sub

Private Sub Command2_Click()


If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select * from Hedgehog_table where Code like '" & Text1.Text & "'", Cn, 1, 4

If Rs!Code<> Text1.Text Or Text1.Text = "" Then


MsgBox "Code not found", vbOKOnly, "SYSTEM"

Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""

PETSHOP INVENTORY SYSTEM Page 53


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Text8.Text = ""
Text9.Text = ""
text10.Text = ""
Text11.Text = ""
path.Caption = "D:\Pet Shop\2x2.jpg"
Picture1.Picture = LoadPicture("D:\Pet Shop\2x2.jpg")

Command1.Enabled = False
Command3.Enabled = False
Command4.Enabled = False
Command5.Enabled = False

Else
Text2.Text = Rs!Breed
Text3.Text = Rs!Color
Text4.Text = Rs!Gender
Text5.Text = Rs!AGE
Text6.Text = Rs!PetFood
Text7.Text = Rs!Cage
Text8.Text = Rs!dateRcv
Text9.Text = Rs!Birthday
text10.Text = Rs!Medicine
Text11.Text = Rs!Price
path.Caption = Rs!Picture
Picture1.Picture = LoadPicture(Rs!Picture)

Command1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Text6.Enabled = True
Text7.Enabled = True
Text8.Enabled = True
Text9.Enabled = True
text10.Enabled = True
Text11.Enabled = True
End If
End Sub

Private Sub Command3_Click()


If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Or Text5.Text = "" Or Text6.Text
= "" Or Text7.Text = "" Or Text8.Text = "" Or Text9.Text = "" Or text10.Text = "" Or Text11.Text = "" Then
MsgBox "FILL UP ALL INFO", vbOKOnly, "SYSTEM"

PETSHOP INVENTORY SYSTEM Page 54


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Else
If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select count(code) as cnt from Hedgehog_Table where code like '" & Text1.Text & "'", Cn, 1, 4

If Rs!cnt> 0 Then
MsgBox "PET CODE ALREADY EXIST!", vbOKOnly, "SYSTEM"
Text1.SetFocus
Rs.Close
Cn.Close
Else
Cn.Execute "INSERT into
Hedgehog_table(Code,Breed,Color,Gender,Age,PetFood,Cage,DateRcv,Birthday,Medicine,Price,Picture)
values('" & Text1.Text & "','" & Text2.Text & "','" & Text3.Text & "','" & Text4.Text & "','" & Text5.Text &
"','" & Text6.Text & "','" & Text7.Text & "','" & Text8.Text & "','" & Text9.Text & "', '" & text10.Text & "','"
& Text11.Text & "','" & path.Caption & "') "
MsgBox "SAVE SUCCESSFUL"
End If
End If
End Sub

Private Sub Command4_Click()


If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Or Text5.Text = "" Or Text6.Text
= "" Then
MsgBox "FILL UP ALL INFO", vbOKOnly, "SYSTEM"

Else
If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select count(code) as cnt from Hedgehog_table where code like '" & Text1.Text & "'", Cn, 1, 4

If Rs!cnt = 0 Then
MsgBox "PET CODE IS NOT VALID!", vbOKOnly, "SYSTEM"

Else

Cn.Execute "UPDATE Hedgehog_table set Breed = '" & Text2.Text & "',Color ='" & Text3.Text & "',Gender
='" & Text4.Text & "',Age='" & Text5.Text & "',PetFood ='" & Text6.Text & "',Cage ='" & Text7.Text &
"',DateRcv ='" & Text8.Text & "',Birthday ='" & Text9.Text & "',Medicine ='" & text10.Text & "',Price='" &
Text11.Text & "', Picture= '" & path.Caption & "' where CODE like '" & Text1.Text & "'"
MsgBox "RECORD UPDATED", vbOKOnly, "SYSTEM"

End If

PETSHOP INVENTORY SYSTEM Page 55


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

End If
End Sub

Private Sub Command5_Click()


If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select count(code) as cnt from Hedgehog_table where code like '" & Text1.Text & "'", Cn, 1, 4
If Rs!cnt = 0 Then
MsgBox "PET CODE IS NOT VALID!", vbOKOnly, "SYSTEM"
Rs.Close
Cn.Close
Exit Sub
End If

define = MsgBox("DELETE THIS RECORD?", vbYesNo)


If define = vbYes Then

Cn.Execute "Delete from Hedgehog_table where Code like '" & Text1.Text & "'"
MsgBox "RECORD DELETED", vbOKOnly
End If
End Sub

Private Sub Command6_Click()


Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
text10.Text = ""
Text11.Text = ""
path.Caption = "D:\Pet Shop\2x2.jpg"
Picture1.Picture = LoadPicture("D:\Pet Shop\2x2.jpg")

Text1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Text6.Enabled = True
Text7.Enabled = True

PETSHOP INVENTORY SYSTEM Page 56


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Text8.Enabled = True
Text9.Enabled = True
text10.Enabled = True
Text11.Enabled = True
Picture1.Enabled = True
End Sub

Private Sub Form_Load()

If Cn.State = 1 Then Cn.Close


conndb
Rs.Open "select * from Hedgehog_table ORDER by Code Asc", Cn, 1, 4
Set MSHFlexGrid1.DataSource = Rs

With Me.MSHFlexGrid1
.ColWidth(0) = 1400
.ColWidth(1) = 4000
.ColWidth(2) = 2200
.ColWidth(3) = 2200
.ColWidth(4) = 2200
.ColWidth(5) = 0
.ColWidth(6) = 0
.ColWidth(7) = 0
.ColWidth(8) = 0
.ColWidth(9) = 0
.ColWidth(10) = 0
.ColWidth(11) = 0
.ColWidth(12) = 0
.ColWidth(13) = 0
.ColWidth(14) = 0
.ColWidth(15) = 2200

.Row = 0
.Text = "CODE"
.Col = 1
.Text = "BREED"
.Col = 2
.Text = "COLOR"
.Col = 3
.Text = "GENDER"
.Col = 4
.Text = "SIZE"
.Col = 5
.Text = "PRICE"

PETSHOP INVENTORY SYSTEM Page 57


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

End With
Rs.Close
Cn.Close
End Sub

Private Sub Picture1_Click()


dlg.Filter = "JPEG Photo (*jpg)|*.jpg|Bitmap File (*.bmp)|*.bmp"
dlg.FilterIndex = 1
dlg.CancelError = True
On Error Resume Next
dlg.ShowOpen
If Err.Number = cdlCancel Then
Exit Sub
Else
If Err.Number <> 0 Then
MsgBox "Error "& Format$(Err.Number) & _
" selecting file." & vbCrLf & _
Err.Description
Exit Sub
End If

On Error GoTo 0
path.Caption = dlg.FileName
Picture1.Visible = True
Picture1.Picture = LoadPicture(dlg.FileName)
End If
End Sub

Private Sub Timer1_Timer()


lbl_date.Caption = Format(Now, "MMMM dd,yyyy")
End Sub

PETSHOP INVENTORY SYSTEM Page 58


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

RABBIT_FORM
Private Sub Command1_Click()
If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select count(code) as cnt from Rabbit_Table where code like '" & Text1.Text & "'", Cn, 1, 4

RabbitPrinting.Show
If Trim(Text1.Text) <> "" Then
If DataEnvironment1.rsRabbitCommand.State = adStateOpen Then
DataEnvironment1.rsRabbitCommand.Close
DataEnvironment1.RabbitCommand Text1.Text & "%"

RabbitPrinting.Show
End If

Cn.Execute "INSERT into


sold_table(Code,Breed,Color,Gender,Age,PetFood,Cage,DateRcv,Birthday,Vaccine1,Vaccine2,Vaccine3,V
accine4,Vaccine5,Medicine,Price,BuyDate,Picture) values('" & Text1.Text & "','" & Text2.Text & "','" &
Text3.Text & "','" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text & "','" & Text7.Text & "','" &
Text8.Text & "','" & Text9.Text & "','" & lbl_vaccine.Caption & "','" & lbl_vaccine.Caption & "','" &
lbl_vaccine.Caption & "','" & lbl_vaccine.Caption & "','" & lbl_vaccine.Caption & "','" & text10.Text & "','"
& Text11.Text & "','" & lbl_date.Caption & "','" & path.Caption & "') "

Cn.Execute "DELETE from Rabbit_table where code like '" & Text1.Text & "' "

MsgBox "THANK YOU FOR BUYING!", vbOKOnly, ":)"


Command6_Click
End Sub

Private Sub Command2_Click()

If Cn.State = 1 Then Cn.Close


conndb
Rs.Open "select * from Rabbit_table where Code like '" & Text1.Text & "'", Cn, 1, 4

If Rs!Code<> Text1.Text Or Text1.Text = "" Then


MsgBox "Code not found", vbOKOnly, "SYSTEM"

Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""

PETSHOP INVENTORY SYSTEM Page 59


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
text10.Text = ""
Text11.Text = ""
path.Caption = "D:\Pet Shop\2x2.jpg"
Picture1.Picture = LoadPicture("D:\Pet Shop\2x2.jpg")

Command1.Enabled = False
Command3.Enabled = False
Command4.Enabled = False
Command5.Enabled = False
Picture1.Enabled = False

Else
Text2.Text = Rs!Breed
Text3.Text = Rs!Color
Text4.Text = Rs!Gender
Text5.Text = Rs!AGE
Text6.Text = Rs!PetFood
Text7.Text = Rs!Cage
Text8.Text = Rs!dateRcv
Text9.Text = Rs!Birthday
text10.Text = Rs!Medicine
Text11.Text = Rs!Price
path.Caption = Rs!Picture
Picture1.Picture = LoadPicture("D:\Pet Shop\2x2.jpg")

Command1.Enabled = True

Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Text6.Enabled = True
Text7.Enabled = True
Text8.Enabled = True
Text9.Enabled = True
text10.Enabled = True
Text11.Enabled = True
Picture1.Enabled = True

End If

PETSHOP INVENTORY SYSTEM Page 60


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

End Sub

Private Sub Command3_Click()


If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Or Text5.Text = "" Or Text6.Text
= "" Or Text7.Text = "" Or Text8.Text = "" Or Text9.Text = "" Or text10.Text = "" Or Text11.Text = "" Then
MsgBox "FILL UP ALL INFO", vbOKOnly, "SYSTEM"

Else

If Cn.State = 1 Then Cn.Close


conndb
Rs.Open "select count(code) as cnt from Rabbit_Table where code like '" & Text1.Text & "'", Cn, 1, 4

If Rs!cnt> 0 Then
MsgBox "PET CODE ALREADY EXIST!", vbOKOnly, "SYSTEM"
Text1.SetFocus
Rs.Close
Cn.Close
Else
Cn.Execute "INSERT into
Rabbit_table(Code,Breed,Color,Gender,Age,PetFood,Cage,DateRcv,Birthday,Medicine,Price,Picture)
values('" & Text1.Text & "','" & Text2.Text & "','" & Text3.Text & "','" & Text4.Text & "','" & Text5.Text &
"','" & Text6.Text & "','" & Text7.Text & "','" & Text8.Text & "','" & Text9.Text & "', '" & text10.Text & "','"
& Text11.Text & "','" & path.Caption & "') "
MsgBox "SAVE SUCCESSFUL"
End If
End If
End Sub

Private Sub Command4_Click()


If Text1.Text = "" Or Text2.Text = "" Or Text3.Text = "" Or Text4.Text = "" Or Text5.Text = "" Or Text6.Text
= "" Then
MsgBox "FILL UP ALL INFO", vbOKOnly, "SYSTEM"

Else

If Cn.State = 1 Then Cn.Close


conndb
Rs.Open "select count(code) as cnt from Rabbit_table where code like '" & Text1.Text & "'", Cn, 1, 4

If Rs!cnt = 0 Then

PETSHOP INVENTORY SYSTEM Page 61


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

MsgBox "PET CODE IS NOT VALID!", vbOKOnly, "SYSTEM"

Else

Cn.Execute "UPDATE Rabbit_table set Breed = '" & Text2.Text & "',Color ='" & Text3.Text & "',Gender ='"
& Text4.Text & "',Age='" & Text5.Text & "',PetFood ='" & Text6.Text & "',Cage ='" & Text7.Text &
"',DateRcv ='" & Text8.Text & "',Birthday ='" & Text9.Text & "',Medicine ='" & text10.Text & "',Price='" &
Text11.Text & "', Picture= '" & path.Caption & "' where CODE like '" & Text1.Text & "'"
MsgBox "RECORD UPDATED", vbOKOnly, "SYSTEM"

End If
End If
End Sub

Private Sub Command5_Click()


If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select count(code) as cnt from Rabbit_table where code like '" & Text1.Text & "'", Cn, 1, 4

If Rs!cnt = 0 Then
MsgBox "PET CODE IS NOT VALID!", vbOKOnly, "SYSTEM"

Rs.Close
Cn.Close
Exit Sub
End If

define = MsgBox("DELETE THIS RECORD?", vbYesNo)

If define = vbYes Then

Cn.Execute "Delete from Rabbit_table where Code like '" & Text1.Text & "'"
MsgBox "RECORD DELETED", vbOKOnly

End If

End Sub

Private Sub Command6_Click()


Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""

PETSHOP INVENTORY SYSTEM Page 62


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
text10.Text = ""
Text11.Text = ""
path.Caption = "D:\Pet Shop\2x2.jpg"
Picture1.Picture = LoadPicture("D:\Pet Shop\2x2.jpg")

Text1.Enabled = True
Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Text6.Enabled = True
Text7.Enabled = True
Text8.Enabled = True
Text9.Enabled = True
text10.Enabled = True
Text11.Enabled = True
Picture1.Enabled = True
End Sub

Private Sub Form_Load()


If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select * from Rabbit_table ORDER by Code Asc", Cn, 1, 4
Set MSHFlexGrid1.DataSource = Rs

With Me.MSHFlexGrid1
.ColWidth(0) = 1400
.ColWidth(1) = 4000
.ColWidth(2) = 2200
.ColWidth(3) = 2200
.ColWidth(4) = 2200
.ColWidth(5) = 0
.ColWidth(6) = 0
.ColWidth(7) = 0
.ColWidth(8) = 0
.ColWidth(9) = 0
.ColWidth(10) = 0
.ColWidth(11) = 0
.ColWidth(12) = 0

PETSHOP INVENTORY SYSTEM Page 63


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

.ColWidth(13) = 0
.ColWidth(14) = 0
.ColWidth(15) = 2200
.Row = 0
.Text = "CODE"
.Col = 1
.Text = "BREED"
.Col = 2
.Text = "COLOR"
.Col = 3
.Text = "GENDER"
.Col = 4
.Text = "SIZE"
.Col = 5
.Text = "PRICE"
End With
Rs.Close
Cn.Close
End Sub
Private Sub Picture1_Click()
dlg.Filter = "JPEG Photo (*jpg)|*.jpg|Bitmap File (*.bmp)|*.bmp"
dlg.FilterIndex = 1
dlg.CancelError = True
On Error Resume Next
dlg.ShowOpen
If Err.Number = cdlCancel Then
Exit Sub
Else
If Err.Number <> 0 Then
MsgBox "Error "& Format$(Err.Number) & _
" selecting file." & vbCrLf & _
Err.Description
Exit Sub
End If

On Error GoTo 0
path.Caption = dlg.FileName
Picture1.Visible = True
Picture1.Picture = LoadPicture(dlg.FileName)
End If
End Sub

Private Sub Timer1_Timer()


lbl_date.Caption = Format(Now, "MMMM dd,yyyy")
End Sub

PETSHOP INVENTORY SYSTEM Page 64


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

CAGE_FORM
Private Sub Command1_Click()
If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select count(code) as cnt from CagesAquarium_table where code like '" & Text1.Text & "' ",
Cn, 1, 4

CagePrinting.Show
If Trim(Text1.Text) <> "" Then
If DataEnvironment1.rsCageCommand.State = adStateOpen Then
DataEnvironment1.rsCageCommand.Close
DataEnvironment1.CageCommand Text1.Text & "%"

CagePrinting.Show
End If

Cn.Execute "INSERT into SoldCages_table(Code,CageName,CageSize,noPiece,Price,TotalPrice,Picture)


values('" & Text1.Text & "','" & Text2.Text & "','" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text &
"','" & Text7.Text & "','" & path.Caption & "') "

Cn.Execute "DELETE from CagesAquarium_table where code like '" & Text1.Text & "' "
MsgBox "THANK YOU FOR BUYING!", vbOKOnly, ":)"

End Sub

Private Sub Command2_Click()


If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "Select * from CagesAquarium_table where Code like '" & Text1.Text & "'", Cn, 1, 4

If Rs!Code<> Text1.Text Or Text1.Text = "" Then


MsgBox "CODE NOT FOUND", vbOKOnly, "SYSTEM"

Text1.Text = ""
Text2.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
path.Caption = "D:\Pet Shop\2x2.jpg"
Picture1.Picture = LoadPicture("D:\Pet Shop\2x2.jpg")
Else

PETSHOP INVENTORY SYSTEM Page 65


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Text2.Text = Rs!CageName
Text4.Text = Rs!CageSize
Text5.Text = Rs!NoPiece
Text6.Text = Rs!Price
Text7.Text = Rs!TotalPrice
path.Caption = Rs!Picture
Picture1.Picture = LoadPicture(Rs!Picture)

Command1.Enabled = True
Text2.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Text6.Enabled = True
Text7.Enabled = True
Picture1.Enabled = True

End If
End Sub

Private Sub Command3_Click()


If Text1.Text = "" Or Text2.Text = "" Or Text4.Text = "" Or Text5.Text = "" Or Text6.Text = "" Or Text7.Text
= "" Then
MsgBox "FILL UP ALL INFO", vbOKOnly, "SYSTEM"

Else
If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select count(code) as cnt from CagesAquarium_Table where code like '" & Text1.Text & "'", Cn,
1, 4
If Rs!cnt> 0 Then
MsgBox "PET CODE ALREADY EXIST!", vbOKOnly, "SYSTEM"
Text1.SetFocus
Rs.Close
Cn.Close
Else
Cn.Execute "INSERT into
CagesAquarium_Table(Code,CageName,CageSize,noPiece,Price,TotalPrice,Picture) values('" &
Text1.Text & "','" & Text2.Text & "','" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text & "','" &
Text7.Text & "','" & path.Caption & "') "
MsgBox "SAVE SUCCESSFUL"
End If
End If
End Sub

PETSHOP INVENTORY SYSTEM Page 66


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Private Sub Command4_Click()


If Text1.Text = "" Or Text2.Text = "" Or Text4.Text = "" Or Text5.Text = "" Or Text6.Text = "" Or Text7.Text
= "" Then
MsgBox "FILL UP ALL INFO", vbOKOnly, "SYSTEM"

Else

If Cn.State = 1 Then Cn.Close


conndb
Rs.Open "select count(code) as cnt from CagesAquarium_table where code like '" & Text1.Text & "'", Cn,
1, 4

If Rs!cnt = 0 Then
MsgBox "PET CODE IS NOT VALID!", vbOKOnly, "SYSTEM"

Else

Cn.Execute "UPDATE CagesAquarium_Table set CageName = '" & Text2.Text & "', CageSize = '" &
Text4.Text & "', NoPiece = '" & Text5.Text & "', Price = '" & Text6.Text & "', TotalPrice = '" & Text7.Text &
"', Picture = '" & path.Caption & "' where Code like '" & Text1.Text & "'"
MsgBox "RECORD UPDATED", vbOKOnly, "SYSTEM"

End If
End If
End Sub

Private Sub Command5_Click()


If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select count(code) as cnt from CagesAquarium_table where code like '" & Text1.Text & "'", Cn,
1, 4

If Rs!cnt = 0 Then
MsgBox "PET CODE IS NOT VALID!", vbOKOnly, "SYSTEM"

Rs.Close
Cn.Close
Exit Sub
End If

define = MsgBox("DELETE THIS RECORD?", vbYesNo)


If define = vbYes Then

PETSHOP INVENTORY SYSTEM Page 67


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Cn.Execute "Delete from CagesAquarium_table where Code like '" & Text1.Text & "'"
MsgBox "RECORD DELETED", vbOKOnly
End If
End Sub

Private Sub Command6_Click()


Text1.Text = ""
Text2.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
path.Caption = "D:\Pet Shop\2x2.jpg"
Picture1.Picture = LoadPicture("D:\Pet Shop\2x2.jpg")

Text1.Enabled = True
Text2.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Text6.Enabled = True
Text7.Enabled = True
Picture1.Enabled = True

End Sub

Private Sub Command7_Click()


' arrange by code
If Combo1.Text = "CODE" Then
If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select * from CagesAquarium_table ORDER by Code Asc", Cn, 1, 4
Set MSHFlexGrid1.DataSource = Rs

With Me.MSHFlexGrid1
.ColWidth(0) = 1400
.ColWidth(1) = 4000
.ColWidth(2) = 2200
.ColWidth(3) = 2200
.ColWidth(4) = 2200
.ColWidth(5) = 2200

.Row = 0

PETSHOP INVENTORY SYSTEM Page 68


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

.Text = "CODE"
.Col = 1
.Text = "NAME"
.Col = 2
.Text = "SIZE"
.Col = 3
.Text = "PIECES"
.Col = 4
.Text = "PRICE"
.Col = 5
.Text = "TOTAL PRICE"

End With
Else
' arrange by Size
If Combo1.Text = "SIZE" Then
If Cn.State = 1 Then Cn.Close

conndb
Rs.Open "select * from CagesAquarium_table ORDER by CageSize Asc", Cn, 1, 4
Set MSHFlexGrid1.DataSource = Rs

With Me.MSHFlexGrid1
.ColWidth(0) = 1400
.ColWidth(1) = 4000
.ColWidth(2) = 2200
.ColWidth(3) = 2200
.ColWidth(4) = 2200
.ColWidth(5) = 2200

.Row = 0
.Text = "CODE"
.Col = 1
.Text = "NAME"
.Col = 2
.Text = "SIZE"
.Col = 3
.Text = "PIECES"
.Col = 4
.Text = "PRICE"
.Col = 5
.Text = "TOTAL PRICE"

End With

PETSHOP INVENTORY SYSTEM Page 69


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Else

' arrange by Type of Pet


If Combo1.Text = "TYPE OF PET" Then
If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select * from CagesAquarium_table ORDER by TypeofPet Asc", Cn, 1, 4
Set MSHFlexGrid1.DataSource = Rs

With Me.MSHFlexGrid1
.ColWidth(0) = 1400
.ColWidth(1) = 4000
.ColWidth(2) = 2200
.ColWidth(3) = 2200
.ColWidth(4) = 2200
.ColWidth(5) = 2200

.Row = 0
.Text = "CODE"
.Col = 1
.Text = "NAME"
.Col = 2
.Text = "SIZE"
.Col = 3
.Text = "PIECES"
.Col = 4
.Text = "PRICE"
.Col = 5
.Text = "TOTAL PRICE"

End With

Else

' arrange by Price


If Combo1.Text = "PRICE" Then
Cn.Close
conndb
Rs.Open "select * from CagesAquarium_table ORDER by PRICE Asc", Cn, 1, 4
Set MSHFlexGrid1.DataSource = Rs

With Me.MSHFlexGrid1
.ColWidth(0) = 1400
.ColWidth(1) = 4000

PETSHOP INVENTORY SYSTEM Page 70


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

.ColWidth(2) = 2200
.ColWidth(3) = 2200
.ColWidth(4) = 2200
.ColWidth(5) = 2200

.Row = 0
.Text = "CODE"
.Col = 1
.Text = "NAME"
.Col = 2
.Text = "SIZE"
.Col = 3
.Text = "PIECES"
.Col = 4
.Text = "PRICE"
.Col = 5
.Text = "TOTAL PRICE"

End With
End If
End If
End If
End If
End Sub

Private Sub Form_Load()


If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select * from CagesAquarium_table ORDER by Code Asc", Cn, 1, 4
Set MSHFlexGrid1.DataSource = Rs

With Me.MSHFlexGrid1
.ColWidth(0) = 1400
.ColWidth(1) = 4000
.ColWidth(2) = 2200
.ColWidth(3) = 2200
.ColWidth(4) = 2200
.ColWidth(5) = 2200

.Row = 0
.Text = "CODE"
.Col = 1
.Text = "NAME"
.Col = 2

PETSHOP INVENTORY SYSTEM Page 71


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

.Text = "SIZE"
.Col = 3
.Text = "PIECES"
.Col = 4
.Text = "PRICE"
.Col = 5
.Text = "TOTAL PRICE"
End With
End Sub
Private Sub Picture1_Click()
dlg.Filter = "JPEG Photo (*jpg)|*.jpg|Bitmap File (*.bmp)|*.bmp"
dlg.FilterIndex = 1
dlg.CancelError = True
On Error Resume Next
dlg.ShowOpen
If Err.Number = cdlCancel Then
Exit Sub
Else
If Err.Number <> 0 Then
MsgBox "Error "& Format$(Err.Number) & _
" selecting file." & vbCrLf & _
Err.Description
Exit Sub
End If

On Error GoTo 0
path.Caption = dlg.FileName
Picture1.Visible = True
Picture1.Picture = LoadPicture(dlg.FileName)
End If
End Sub

Private Sub Text6_LostFocus()


Text7.Text = Val(Text5.Text) * Val(Text6.Text)
End Sub

Private Sub Text5_LostFocus()


Text6.Text = Val(Text5.Text) * Val(Text6.Text)
End Sub

Private Sub Timer1_Timer()


lbl_date.Caption = Format(Now, "MMMM dd,yyyy")
End Sub

PETSHOP INVENTORY SYSTEM Page 72


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

PETFOOD_FORM
Private Sub Command1_Click()
If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select count(code) as cnt from Food_table where code like '" & Text1.Text & "' ", Cn, 1, 4

FoodPrinting.Show
If Trim(Text1.Text) <> "" Then
If DataEnvironment1.rsFoodCommand.State = adStateOpen Then
DataEnvironment1.rsFoodCommand.Close
DataEnvironment1.FoodCommand Text1.Text & "%"

FoodPrinting.Show
End If

Cn.Execute "INSERT into


SoldPetFood_table(Code,FoodName,FoodAmount,noPiece,Price,TotalPrice,BuyDate,Picture) values('" &
Text1.Text & "','" & Text2.Text & "','" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text & "','" &
Text7.Text & "','" & lbl_date.Caption & "','" & path.Caption & "') "

Cn.Execute "DELETE from Food_table where code like '" & Text1.Text & "' "

MsgBox "THANK YOU FOR BUYING!", vbOKOnly, ":)"

End Sub

Private Sub Command2_Click()


If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "Select * from Food_table where Code like '" & Text1.Text & "'", Cn, 1, 4

If Rs!Code<> Text1.Text Or Text1.Text = "" Then


MsgBox "CODE NOT FOUND", vbOKOnly, "SYSTEM"

Text1.Text = ""
Text2.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""

PETSHOP INVENTORY SYSTEM Page 73


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Text7.Text = ""
path.Caption = "D:\Pet Shop\2x2.jpg"
Picture1.Picture = LoadPicture("D:\Pet Shop\2x2.jpg")
Else

Text2.Text = Rs!FoodName
Text4.Text = Rs!FoodAmount
Text5.Text = Rs!NoPiece
Text6.Text = Rs!Price
Text7.Text = Rs!TotalPrice
path.Caption = Rs!Picture
Picture1.Picture = LoadPicture(Rs!Picture)

Command1.Enabled = True

Text2.Enabled = True
Text3.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Text6.Enabled = True
Text7.Enabled = True
Picture1.Enabled = True

End If
End Sub

Private Sub Command3_Click()


If Text1.Text = "" Or Text2.Text = "" Or Text4.Text = "" Or Text5.Text = "" Or Text6.Text = "" Or Text7.Text
= "" Then
MsgBox "FILL UP ALL INFO", vbOKOnly, "SYSTEM"

Else

If Cn.State = 1 Then Cn.Close


conndb
Rs.Open "select count(code) as cnt from Food_table where code like '" & Text1.Text & "'", Cn, 1, 4
If Rs!cnt> 0 Then
MsgBox "PET CODE ALREADY EXIST!", vbOKOnly, "SYSTEM"
Text1.SetFocus
Rs.Close
Cn.Close
Else

PETSHOP INVENTORY SYSTEM Page 74


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Cn.Execute "INSERT into Food_table(Code,FoodName,FoodAmount,noPiece,Price,TotalPrice) values('" &


Text1.Text & "','" & Text2.Text & "','" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text & "','" &
Text7.Text & "') "
MsgBox "SAVE SUCCESSFUL"
End If
End If
End Sub

Private Sub Command4_Click()


If Text1.Text = "" Or Text2.Text = "" Or Text4.Text = "" Or Text5.Text = "" Or Text6.Text = "" Or Text7.Text
= "" Then
MsgBox "FILL UP ALL INFO", vbOKOnly, "SYSTEM"

Else

If Cn.State = 1 Then Cn.Close


conndb
Rs.Open "select count(code) as cnt from Food_table where code like '" & Text1.Text & "'", Cn, 1, 4

If Rs!cnt = 0 Then
MsgBox "PET CODE IS NOT VALID!", vbOKOnly, "SYSTEM"

Else

Cn.Execute "UPDATE Food_table set FoodName = '" & Text2.Text & "', FoodAmount = '" & Text4.Text &
"', NoPiece = '" & Text5.Text & "', Price = '" & Text6.Text & "', TotalPrice = '" & Text7.Text & "',Picture = '"
& path.Caption & "' where Code like '" & Text1.Text & "'"
MsgBox "RECORD UPDATED", vbOKOnly, "SYSTEM"

End If

End Sub

Private Sub Command5_Click()


If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select count(code) as cnt from Food_table where code like '" & Text1.Text & "'", Cn, 1, 4

If Rs!cnt = 0 Then
MsgBox "PET CODE IS NOT VALID!", vbOKOnly, "SYSTEM"

Rs.Close
Cn.Close

PETSHOP INVENTORY SYSTEM Page 75


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Exit Sub
End If

define = MsgBox("DELETE THIS RECORD?", vbYesNo)

If define = vbYes Then

Cn.Execute "Delete from Food_table where Code like '" & Text1.Text & "'"
MsgBox "RECORD DELETED", vbOKOnly

End If

End Sub

Private Sub Command6_Click()


Text1.Text = ""
Text2.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
path.Caption = "D:\Pet Shop\2x2.jpg"
Picture1.Picture = LoadPicture("D:\Pet Shop\2x2.jpg")

Text1.Enabled = True
Text2.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Text6.Enabled = True
Text7.Enabled = True
Picture1.Enabled = True

End Sub

Private Sub Command7_Click()


' arrange by code
If Combo1.Text = "CODE" Then
If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select * from Food_table ORDER by Code Asc", Cn, 1, 4
Set MSHFlexGrid1.DataSource = Rs

PETSHOP INVENTORY SYSTEM Page 76


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

With Me.MSHFlexGrid1
.ColWidth(0) = 1400
.ColWidth(1) = 4000
.ColWidth(2) = 2200
.ColWidth(3) = 2200
.ColWidth(4) = 2200
.ColWidth(5) = 2200

.Row = 0
.Text = "CODE"
.Col = 1
.Text = "NAME"
.Col = 2
.Text = "SIZE"
.Col = 3
.Text = "PIECES"
.Col = 4
.Text = "PRICE"
.Col = 5
.Text = "TOTAL PRICE"

End With
Else
' arrange by Size
If Combo1.Text = "SIZE" Then
If Cn.State = 1 Then Cn.Close

conndb
Rs.Open "select * from Food_table ORDER by FoodAmount Asc", Cn, 1, 4
Set MSHFlexGrid1.DataSource = Rs

With Me.MSHFlexGrid1
.ColWidth(0) = 1400
.ColWidth(1) = 4000
.ColWidth(2) = 2200
.ColWidth(3) = 2200
.ColWidth(4) = 2200
.ColWidth(5) = 2200

.Row = 0
.Text = "CODE"
.Col = 1
.Text = "NAME"
.Col = 2

PETSHOP INVENTORY SYSTEM Page 77


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

.Text = "SIZE"
.Col = 3
.Text = "PIECES"
.Col = 4
.Text = "PRICE"
.Col = 5
.Text = "TOTAL PRICE"

End With

Else

' arrange by Price


If Combo1.Text = "PRICE" Then
Cn.Close
conndb
Rs.Open "select * from Food_table ORDER by PRICE Asc", Cn, 1, 4
Set MSHFlexGrid1.DataSource = Rs

With Me.MSHFlexGrid1
.ColWidth(0) = 1400
.ColWidth(1) = 4000
.ColWidth(2) = 2200
.ColWidth(3) = 2200
.ColWidth(4) = 2200
.ColWidth(5) = 2200

.Row = 0
.Text = "CODE"
.Col = 1
.Text = "NAME"
.Col = 2
.Text = "SIZE"
.Col = 3
.Text = "PIECES"
.Col = 4
.Text = "PRICE"
.Col = 5
.Text = "TOTAL PRICE"

End With
End If
End If
End If

PETSHOP INVENTORY SYSTEM Page 78


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

End Sub

Private Sub Form_Load()


If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select * from Food_table ORDER by Code Asc", Cn, 1, 4
Set MSHFlexGrid1.DataSource = Rs

With Me.MSHFlexGrid1
.ColWidth(0) = 1400
.ColWidth(1) = 4000
.ColWidth(2) = 2200
.ColWidth(3) = 2200
.ColWidth(4) = 2200
.ColWidth(5) = 2200

.Row = 0
.Text = "CODE"
.Col = 1
.Text = "NAME"
.Col = 2
.Text = "SIZE"
.Col = 3
.Text = "PIECES"
.Col = 4
.Text = "PRICE"
.Col = 5
.Text = "TOTAL PRICE"

End With
End Sub

Private Sub Picture1_Click()


dlg.Filter = "JPEG Photo (*jpg)|*.jpg|Bitmap File (*.bmp)|*.bmp"
dlg.FilterIndex = 1
dlg.CancelError = True
On Error Resume Next
dlg.ShowOpen
If Err.Number = cdlCancel Then
Exit Sub
Else
If Err.Number <> 0 Then
MsgBox "Error "& Format$(Err.Number) & _
" selecting file." & vbCrLf & _

PETSHOP INVENTORY SYSTEM Page 79


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Err.Description
Exit Sub
End If

On Error GoTo 0
path.Caption = dlg.FileName
Picture1.Visible = True
Picture1.Picture = LoadPicture(dlg.FileName)
End If
End Sub

Private Sub Text6_LostFocus()


Text7.Text = Val(Text5.Text) * Val(Text6.Text)
End Sub

Private Sub Text5_LostFocus()


Text7.Text = Val(Text5.Text) * Val(Text6.Text)
End Sub

Private Sub Timer1_Timer()


lbl_date.Caption = Format(Now, "MMMM dd,yyyy")
End Sub

SOLD
Private Sub cmd_arrange_Click()
If combo_arrange.Text = "TYPE" Then
conndb
Rs.Open "select * from SOLD_table ORDER by Code Asc", Cn, 1, 4
Set MSHFlexGrid1.DataSource = Rs

With Me.MSHFlexGrid1
.ColWidth(0) = 1200
.ColWidth(1) = 4000
.ColWidth(2) = 1000
.ColWidth(3) = 1000
.ColWidth(4) = 1000
.ColWidth(5) = 0

PETSHOP INVENTORY SYSTEM Page 80


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

.ColWidth(6) = 1000
.ColWidth(7) = 1500
.ColWidth(8) = 1500
.ColWidth(9) = 0
.ColWidth(10) = 0
.ColWidth(11) = 0
.ColWidth(12) = 0
.ColWidth(16) = 2000

.Row = 0
.Text = "CODE"
.Col = 1
.Text = "BREED"
.Col = 2
.Text = "COLOR"
.Col = 3
.Text = "GENDER"
.Col = 4
.Text = "AGE"
.Col = 5
.Text = "PET FOOD"
.Col = 6
.Text = "CAGE"
.Col = 7
.Text = "DATE RECV"
.Col = 8
.Text = "BIRTHDAY"
.Col = 9
.Text = "VACCINE1"
.Col = 10
.Text = "VACCINE2"
.Col = 11
.Text = "VACCINE3"
.Col = 12
.Text = "VACCINE4"
.Col = 13
.Text = "VACCINE5"
.Col = 14
.Text = "MEDICINE"
.Col = 15
.Text = "PRICE"

End With

PETSHOP INVENTORY SYSTEM Page 81


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Rs.Close
Cn.Close
Else

'Date
If combo_arrange.Text = "DATE" Then
conndb
Rs.Open "select * from SOLD_table ORDER by BuyDate Asc", Cn, 1, 4
Set MSHFlexGrid1.DataSource = Rs

With Me.MSHFlexGrid1
.ColWidth(0) = 1200
.ColWidth(1) = 4000
.ColWidth(2) = 1000
.ColWidth(3) = 1000
.ColWidth(4) = 1000
.ColWidth(5) = 0
.ColWidth(6) = 1000
.ColWidth(7) = 1500
.ColWidth(8) = 1500
.ColWidth(9) = 0
.ColWidth(10) = 0
.ColWidth(11) = 0
.ColWidth(12) = 0
.ColWidth(16) = 2000

.Row = 0
.Text = "CODE"
.Col = 1
.Text = "BREED"
.Col = 2
.Text = "COLOR"
.Col = 3
.Text = "GENDER"
.Col = 4
.Text = "AGE"
.Col = 5
.Text = "PET FOOD"
.Col = 6
.Text = "CAGE"
.Col = 7
.Text = "DATE RECV"

PETSHOP INVENTORY SYSTEM Page 82


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

.Col = 8
.Text = "BIRTHDAY"
.Col = 9
.Text = "VACCINE1"
.Col = 10
.Text = "VACCINE2"
.Col = 11
.Text = "VACCINE3"
.Col = 12
.Text = "VACCINE4"
.Col = 13
.Text = "VACCINE5"
.Col = 14
.Text = "MEDICINE"
.Col = 15
.Text = "PRICE"

End With
Rs.Close
Cn.Close
Else
'PRICE
If combo_arrange.Text = "PRICE" Then
conndb
Rs.Open "select * from SOLD_table ORDER by Price Asc", Cn, 1, 4
Set MSHFlexGrid1.DataSource = Rs

With Me.MSHFlexGrid1
.ColWidth(0) = 1200
.ColWidth(1) = 4000
.ColWidth(2) = 1000
.ColWidth(3) = 1000
.ColWidth(4) = 1000
.ColWidth(5) = 0
.ColWidth(6) = 1000
.ColWidth(7) = 1500
.ColWidth(8) = 1500
.ColWidth(9) = 0
.ColWidth(10) = 0
.ColWidth(11) = 0
.ColWidth(12) = 0

PETSHOP INVENTORY SYSTEM Page 83


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

.ColWidth(16) = 2000

.Row = 0
.Text = "CODE"
.Col = 1
.Text = "BREED"
.Col = 2
.Text = "COLOR"
.Col = 3
.Text = "GENDER"
.Col = 4
.Text = "AGE"
.Col = 5
.Text = "PET FOOD"
.Col = 6
.Text = "CAGE"
.Col = 7
.Text = "DATE RECV"
.Col = 8
.Text = "BIRTHDAY"
.Col = 9
.Text = "VACCINE1"
.Col = 10
.Text = "VACCINE2"
.Col = 11
.Text = "VACCINE3"
.Col = 12
.Text = "VACCINE4"
.Col = 13
.Text = "VACCINE5"
.Col = 14
.Text = "MEDICINE"
.Col = 15
.Text = "PRICE"

End With
Rs.Close
Cn.Close
End If
End If
End If
End Sub

PETSHOP INVENTORY SYSTEM Page 84


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Private Sub Command1_Click()


TYPEOFPET.Show
End Sub

Private Sub Command2_Click()


If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "Select * from SOLD_table where Recordno like '" & txt_recordno.Text & "'", Cn, 1, 4

If Rs!Recordno<> txt_recordno.Text Or txt_recordno.Text = "" Then


MsgBox "RECORD NUMBER NOT FOUND", vbOKOnly, "SYSTEM"

Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
text10.Text = ""
Text11.Text = ""
Combo1.Text = ""
Combo2.Text = ""
Combo3.Text = ""
Combo4.Text = ""
Combo5.Text = ""
path.Caption = "D:\Pet Shop\2x2.jpg"
Picture1.Picture = LoadPicture("D:\Pet Shop\2x2.jpg")
Else

Text1.Text = Rs!Code
Text2.Text = Rs!Breed
Text3.Text = Rs!Color
Text4.Text = Rs!Gender
Text5.Text = Rs!AGE
Text6.Text = Rs!PetFood
Text7.Text = Rs!Cage
Text8.Text = Rs!dateRcv
Text9.Text = Rs!Birthday
text10.Text = Rs!Medicine
Text11.Text = Rs!Price
Combo1.Text = Rs!vaccine1

PETSHOP INVENTORY SYSTEM Page 85


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Combo2.Text = Rs!vaccine2
Combo3.Text = Rs!vaccine3
Combo4.Text = Rs!vaccine4
Combo5.Text = Rs!vaccine5
path.Caption = Rs!Picture
Picture1.Picture = LoadPicture(Rs!Picture)

Command1.Enabled = True
Picture1.Enabled = True
End If
End Sub

Private Sub Form_Load()

If Cn.State = 1 Then Cn.Close


conndb
Rs.Open "select * from SOLD_table ORDER by BuyDate Asc", Cn, 1, 4
Set MSHFlexGrid1.DataSource = Rs

With Me.MSHFlexGrid1
.ColWidth(0) = 1000
.ColWidth(1) = 1200
.ColWidth(2) = 4000
.ColWidth(3) = 1000
.ColWidth(4) = 1000
.ColWidth(5) = 1000
.ColWidth(6) = 0
.ColWidth(7) = 1000
.ColWidth(8) = 1500
.ColWidth(9) = 1500
.ColWidth(10) = 0
.ColWidth(11) = 0
.ColWidth(12) = 0
.ColWidth(13) = 0
.ColWidth(15) = 2000

.Row = 0
.Text = "RECODNO"
.Col = 1
.Text = "CODE"
.Col = 2
.Text = "BREED"
.Col = 3
.Text = "COLOR

PETSHOP INVENTORY SYSTEM Page 86


"
Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

.Col = 4
.Text = "GENDER"
.Col = 5
.Text = "AGE"
.Col = 6
.Text = "PET FOOD"
.Col = 7
.Text = "CAGE"
.Col = 8
.Text = "DATE RECV"
.Col = 9
.Text = "BIRTHDAY"
.Col = 10
.Text = "VACCINE1"
.Col = 11
.Text = "VACCINE2"
.Col = 12
.Text = "VACCINE3"
.Col = 13
.Text = "VACCINE4"
.Col = 14
.Text = "VACCINE5"
.Col = 15
.Text = "MEDICINE"
.Col = 16
.Text = "PRICE"
End With
Rs.Close
Cn.Close
End Sub

Private Sub Picture1_Click()


dlg.Filter = "JPEG Photo (*jpg)|*.jpg|Bitmap File (*.bmp)|*.bmp"
dlg.FilterIndex = 1
dlg.CancelError = True
On Error Resume Next
dlg.ShowOpen
If Err.Number = cdlCancel Then
Exit Sub
Else
If Err.Number <> 0 Then
MsgBox "Error "& Format$(Err.Number) & _
" selecting file." & vbCrLf & _
Err.Description

PETSHOP INVENTORY SYSTEM Page 87


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Exit Sub
End If

On Error GoTo 0
path.Caption = dlg.FileName
Picture1.Visible = True
Picture1.Picture = LoadPicture(dlg.FileName)
End If
End Sub

Private Sub Timer1_Timer()


lbl_date.Caption = Format(Now, "MMMM dd,yyyy")
End Sub

PETSHOP INVENTORY SYSTEM Page 88


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

SOLDCAGE
Private Sub cmd_arrange_Click()
If combo_arrange.Text = "NAME" Then
conndb
Rs.Open "select * from SOLD_table ORDER by CageName Asc", Cn, 1, 4
Set MSHFlexGrid1.DataSource = Rs

With Me.MSHFlexGrid1
.ColWidth(0) = 1400
.ColWidth(1) = 4000
.ColWidth(2) = 2200
.ColWidth(3) = 2200
.ColWidth(4) = 2200
.ColWidth(5) = 2200

.Row = 0
.Text = "CODE"
.Col = 1
.Text = "NAME"
.Col = 2
.Text = "SIZE"
.Col = 3
.Text = "PIECES"
.Col = 4
.Text = "PRICE"
.Col = 5
.Text = "TOTAL PRICE"

End With
Rs.Close
Cn.Close
Else

'Date
If combo_arrange.Text = "DATE" Then
conndb
Rs.Open "select * from SOLD_table ORDER by BuyDate Asc", Cn, 1, 4
Set MSHFlexGrid1.DataSource = Rs

PETSHOP INVENTORY SYSTEM Page 89


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

With Me.MSHFlexGrid1
.ColWidth(0) = 1400
.ColWidth(1) = 4000
.ColWidth(2) = 2200
.ColWidth(3) = 2200
.ColWidth(4) = 2200
.ColWidth(5) = 2200

.Row = 0
.Text = "CODE"
.Col = 1
.Text = "NAME"
.Col = 2
.Text = "SIZE"
.Col = 3
.Text = "PIECES"
.Col = 4
.Text = "PRICE"
.Col = 5
.Text = "TOTAL PRICE"

End With
Rs.Close
Cn.Close
Else
'PRICE
If combo_arrange.Text = "PRICE" Then
conndb
Rs.Open "select * from SOLD_table ORDER by Price Asc", Cn, 1, 4
Set MSHFlexGrid1.DataSource = Rs

With Me.MSHFlexGrid1
.ColWidth(0) = 1400
.ColWidth(1) = 4000
.ColWidth(2) = 2200
.ColWidth(3) = 2200
.ColWidth(4) = 2200
.ColWidth(5) = 2200

.Row = 0
.Text = "CODE"
.Col = 1

PETSHOP INVENTORY SYSTEM Page 90


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

.Text = "NAME"
.Col = 2
.Text = "SIZE"
.Col = 3
.Text = "PIECES"
.Col = 4
.Text = "PRICE"
.Col = 5
.Text = "TOTAL PRICE"

End With
Rs.Close
Cn.Close
End If
End If
End If
End Sub

Private Sub Command1_Click()


If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select count(code) as cnt from SoldCages_table where code like '" & Text1.Text & "' ", Cn, 1, 4

Cn.Execute "INSERT into


CagesAquarium_table(Code,CageName,CageSize,noPiece,Price,TotalPrice,BuyDate) values('" &
Text1.Text & "','" & Text2.Text & "','" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text & "','" &
Text7.Text & "','" & lbl_date.Caption & "') "

Cn.Execute "DELETE from SoldCages_table where code like '" & Text1.Text & "' "

MsgBox "RETURNING PRODUCT SUCCESSFUL!", vbOKOnly, ":)"

End Sub

Private Sub Command2_Click()


If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "Select * from SoldCages_table where Code like '" & Text1.Text & "'", Cn, 1, 4

If Rs!Code<> Text1.Text Or Text1.Text = "" Then


MsgBox "CODE NOT FOUND", vbOKOnly, "SYSTEM"

Text1.Text = ""
Text2.Text = ""

PETSHOP INVENTORY SYSTEM Page 91


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
path.Caption = "D:\Pet Shop\2x2.jpg"
Picture1.Picture = LoadPicture("D:\Pet Shop\2x2.jpg")
Else

Text2.Text = Rs!CageName
Text4.Text = Rs!CageSize
Text5.Text = Rs!NoPiece
Text6.Text = Rs!Price
Text7.Text = Rs!TotalPrice
path.Caption = Rs!Picture
Picture1.Picture = LoadPicture(Rs!Picture)

Command1.Enabled = True

Text2.Enabled = True
Text4.Enabled = True
Text5.Enabled = True
Text6.Enabled = True
Text7.Enabled = True
Picture1.Enabled = True

End If
End Sub

Private Sub Form_Load()


If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select * from SOLDCAGES_table ORDER by Code Asc", Cn, 1, 4
Set MSHFlexGrid1.DataSource = Rs

With Me.MSHFlexGrid1
.ColWidth(0) = 1400
.ColWidth(1) = 4000
.ColWidth(2) = 2200
.ColWidth(3) = 2200
.ColWidth(4) = 2200
.ColWidth(5) = 2200

.Row = 0
.Text = "CODE"

PETSHOP INVENTORY SYSTEM Page 92


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

.Col = 1
.Text = "NAME"
.Col = 2
.Text = "SIZE"
.Col = 3
.Text = "PIECES"
.Col = 4
.Text = "PRICE"
.Col = 5
.Text = "TOTAL PRICE"
End With
End Sub

Private Sub Picture1_Click()


dlg.Filter = "JPEG Photo (*jpg)|*.jpg|Bitmap File (*.bmp)|*.bmp"
dlg.FilterIndex = 1
dlg.CancelError = True
On Error Resume Next
dlg.ShowOpen
If Err.Number = cdlCancel Then
Exit Sub
Else
If Err.Number <> 0 Then
MsgBox "Error "& Format$(Err.Number) & _
" selecting file." & vbCrLf & _
Err.Description
Exit Sub
End If

On Error GoTo 0
path.Caption = dlg.FileName
Picture1.Visible = True
Picture1.Picture = LoadPicture(dlg.FileName)
End If
End Sub

Private Sub Timer1_Timer()


lbl_date.Caption = Format(Now, "MMMM dd,yyyy")
End Sub

PETSHOP INVENTORY SYSTEM Page 93


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

SOLDFOOD
Private Sub Command1_Click()
If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select count(code) as cnt from SoldCages_table where code like '" & Text1.Text & "' ", Cn, 1, 4

Cn.Execute "INSERT into Food_table(Code,FoodName,FoodAmount,noPiece,Price,TotalPrice,BuyDate)


values('" & Text1.Text & "','" & Text2.Text & "','" & Text4.Text & "','" & Text5.Text & "','" & Text6.Text &
"','" & Text7.Text & "','" & lbl_date.Caption & "') "

Cn.Execute "DELETE from SoldPetFood_table where code like '" & Text1.Text & "' "

MsgBox "THANK YOU FOR BUYING!", vbOKOnly, ":)"

End Sub

Private Sub Command2_Click()


If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "Select * from SOLDPETFOOD_table where Code like '" & Text1.Text & "'", Cn, 1, 4

If Rs!Code<> Text1.Text Or Text1.Text = "" Then


MsgBox "CODE NOT FOUND", vbOKOnly, "SYSTEM"

Text1.Text = ""
Text2.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
path.Caption = "D:\Pet Shop\2x2.jpg"
Picture1.Picture = LoadPicture("D:\Pet Shop\2x2.jpg")
Else

Text2.Text = Rs!CageName
Text4.Text = Rs!CageSize
Text5.Text = Rs!NoPiece
Text6.Text = Rs!Price
Text7.Text = Rs!TotalPrice
path.Caption = Rs!Picture
Picture1.Picture = LoadPicture(Rs!Picture)

Command1.Enabled = True

PETSHOP INVENTORY SYSTEM Page 94


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

End If
End Sub

Private Sub Command7_Click()


' arrange by code
If Combo1.Text = "CODE" Then
If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select * from SoldPetFood_table ORDER by Code Asc", Cn, 1, 4
Set MSHFlexGrid1.DataSource = Rs

With Me.MSHFlexGrid1
.ColWidth(0) = 1400
.ColWidth(1) = 4000
.ColWidth(2) = 2200
.ColWidth(3) = 2200
.ColWidth(4) = 2200
.ColWidth(5) = 2200

.Row = 0
.Text = "CODE"
.Col = 1
.Text = "NAME"
.Col = 2
.Text = "SIZE"
.Col = 3
.Text = "PIECES"
.Col = 4
.Text = "PRICE"
.Col = 5
.Text = "TOTAL PRICE"

End With
Else
' arrange by Size
If Combo1.Text = "SIZE" Then
If Cn.State = 1 Then Cn.Close

conndb
Rs.Open "select * from SoldPetFood_table ORDER by FoodAmount Asc", Cn, 1, 4
Set MSHFlexGrid1.DataSource = Rs

With Me.MSHFlexGrid1
.ColWidth(0) = 1400

PETSHOP INVENTORY SYSTEM Page 95


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

.ColWidth(1) = 4000
.ColWidth(2) = 2200
.ColWidth(3) = 2200
.ColWidth(4) = 2200
.ColWidth(5) = 2200

.Row = 0
.Text = "CODE"
.Col = 1
.Text = "NAME"
.Col = 2
.Text = "SIZE"
.Col = 3
.Text = "PIECES"
.Col = 4
.Text = "PRICE"
.Col = 5
.Text = "TOTAL PRICE"

End With

Else

' arrange by Price


If Combo1.Text = "PRICE" Then
Cn.Close
conndb
Rs.Open "select * from SoldPetFood_table ORDER by PRICE Asc", Cn, 1, 4
Set MSHFlexGrid1.DataSource = Rs

With Me.MSHFlexGrid1
.ColWidth(0) = 1400
.ColWidth(1) = 4000
.ColWidth(2) = 2200
.ColWidth(3) = 2200
.ColWidth(4) = 2200
.ColWidth(5) = 2200

.Row = 0
.Text = "CODE"
.Col = 1
.Text = "NAME"
.Col = 2
.Text = "SIZE"

PETSHOP INVENTORY SYSTEM Page 96


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

.Col = 3
.Text = "PIECES"
.Col = 4
.Text = "PRICE"
.Col = 5
.Text = "TOTAL PRICE"

End With
End If
End If
End If
End Sub

Private Sub Form_Load()


If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select * from SOLDPETFOOD_table ORDER by Code Asc", Cn, 1, 4
Set MSHFlexGrid1.DataSource = Rs

With Me.MSHFlexGrid1
.ColWidth(0) = 1400
.ColWidth(1) = 4000
.ColWidth(2) = 2200
.ColWidth(3) = 2200
.ColWidth(4) = 2200
.ColWidth(5) = 2200

.Row = 0
.Text = "CODE"
.Col = 1
.Text = "NAME"
.Col = 2
.Text = "SIZE"
.Col = 3
.Text = "PIECES"
.Col = 4
.Text = "PRICE"
.Col = 5
.Text = "TOTAL PRICE"

End With
End Sub

Private Sub Picture1_Click()

PETSHOP INVENTORY SYSTEM Page 97


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

dlg.Filter = "JPEG Photo (*jpg)|*.jpg|Bitmap File (*.bmp)|*.bmp"


dlg.FilterIndex = 1
dlg.CancelError = True
On Error Resume Next
dlg.ShowOpen
If Err.Number = cdlCancel Then
Exit Sub
Else
If Err.Number <> 0 Then
MsgBox "Error "& Format$(Err.Number) & _
" selecting file." & vbCrLf & _
Err.Description
Exit Sub
End If

On Error GoTo 0
path.Caption = dlg.FileName
Picture1.Visible = True
Picture1.Picture = LoadPicture(dlg.FileName)
End If
End Sub

Private Sub Timer1_Timer()


lbl_date.Caption = Format(Now, "MMMM dd,yyyy")
End Sub

PETSHOP INVENTORY SYSTEM Page 98


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

TYPEOFPET
Private Sub Command1_Click()

If Combo1.Text = "DOG" Then


If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select count(Recordno) as cnt from Sold_table where code like '" & SOLD.txt_recordno.Text &
"'", Cn, 1, 4

Cn.Execute "INSERT into


Dog_table(Code,Breed,Color,Gender,Age,PetFood,Cage,DateRcv,Birthday,Vaccine1,Vaccine2,Vaccine3,V
accine4,Vaccine5,Medicine,Price,Picture) values('" & SOLD.Text1.Text & "','" & SOLD.Text2.Text & "','" &
SOLD.Text3.Text & "','" & SOLD.Text4.Text & "','" & SOLD.Text5.Text & "','" & SOLD.Text6.Text & "','" &
SOLD.Text7.Text & "','" & SOLD.Text8.Text & "','" & SOLD.Text9.Text & "', '" & SOLD.Combo1.Text & "', '"
& SOLD.Combo2.Text & "', '" & SOLD.Combo3.Text & "', '" & SOLD.Combo4.Text & "', '" &
SOLD.Combo5.Text & "','" & SOLD.text10.Text & "','" & SOLD.Text11.Text & "', '" & SOLD.path.Caption &
"')"

Cn.Execute "DELETE from Sold_table where Recordno like '" & SOLD.txt_recordno.Text & "' "
MsgBox "ITEM RETURN SUCCESFUL", vbOKOnly, ":)"
Unload Me

Else
If Combo1.Text = "BIRD" Then

If Cn.State = 1 Then Cn.Close


conndb
Rs.Open "select count(Recordno) as cnt from Sold_table where code like '" & SOLD.txt_recordno.Text &
"'", Cn, 1, 4

Cn.Execute "INSERT into


BIRD_table(Code,Breed,Color,Gender,Age,PetFood,Cage,DateRcv,Birthday,Medicine,Price,Picture)
values('" & SOLD.Text1.Text & "','" & SOLD.Text2.Text & "','" & SOLD.Text3.Text & "','" &
SOLD.Text4.Text & "','" & SOLD.Text5.Text & "','" & SOLD.Text6.Text & "','" & SOLD.Text7.Text & "','" &
SOLD.Text8.Text & "','" & SOLD.Text9.Text & "','" & SOLD.text10.Text & "','" & SOLD.Text11.Text & "', '"
& SOLD.path.Caption & "')"

Cn.Execute "DELETE from Sold_table where Recordno like '" & SOLD.txt_recordno.Text & "' "
MsgBox "ITEM RETURN SUCCESFUL", vbOKOnly, ":)"
Unload Me

Else

PETSHOP INVENTORY SYSTEM Page 99


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

If Combo1.Text = "CAT" Then

If Cn.State = 1 Then Cn.Close


conndb
Rs.Open "select count(Recordno) as cnt from Sold_table where code like '" & SOLD.txt_recordno.Text &
"'", Cn, 1, 4

Cn.Execute "INSERT into


CAT_table(Code,Breed,Color,Gender,Age,PetFood,Cage,DateRcv,Birthday,Vaccine1,Vaccine2,Vaccine3,V
accine4,Vaccine5,Medicine,Price,Picture) values('" & SOLD.Text1.Text & "','" & SOLD.Text2.Text & "','" &
SOLD.Text3.Text & "','" & SOLD.Text4.Text & "','" & SOLD.Text5.Text & "','" & SOLD.Text6.Text & "','" &
SOLD.Text7.Text & "','" & SOLD.Text8.Text & "','" & SOLD.Text9.Text & "', '" & SOLD.Combo1.Text & "', '"
& SOLD.Combo2.Text & "', '" & SOLD.Combo3.Text & "', '" & SOLD.Combo4.Text & "', '" &
SOLD.Combo5.Text & "','" & SOLD.text10.Text & "','" & SOLD.Text11.Text & "', '" & SOLD.path.Caption &
"')"

Cn.Execute "DELETE from Sold_table where Recordno like '" & SOLD.txt_recordno.Text & "' "
MsgBox "ITEM RETURN SUCCESFUL", vbOKOnly, ":)"
Unload Me

Else
If Combo1.Text = "FISH" Then

If Cn.State = 1 Then Cn.Close


conndb
Rs.Open "select count(Recordno) as cnt from Sold_table where code like '" & SOLD.txt_recordno.Text &
"'", Cn, 1, 4

Cn.Execute "INSERT into


FISH_table(Code,Breed,Color,Gender,Age,PetFood,Cage,DateRcv,Birthday,Medicine,Price,Picture)
values('" & SOLD.Text1.Text & "','" & SOLD.Text2.Text & "','" & SOLD.Text3.Text & "','" &
SOLD.Text4.Text & "','" & SOLD.Text5.Text & "','" & SOLD.Text6.Text & "','" & SOLD.Text7.Text & "','" &
SOLD.Text8.Text & "','" & SOLD.Text9.Text & "','" & SOLD.text10.Text & "','" & SOLD.Text11.Text & "', '"
& SOLD.path.Caption & "')"

Cn.Execute "DELETE from Sold_table where Recordno like '" & SOLD.txt_recordno.Text & "' "

MsgBox "ITEM RETURN SUCCESFUL", vbOKOnly, ":)"


Unload Me

Else
If Combo1.Text = "HEDGEHOG" Then
If Cn.State = 1 Then Cn.Close
Conndb

PETSHOP INVENTORY SYSTEM Page 100


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Rs.Open "select count(Recordno) as cnt from Sold_table where code like '" & SOLD.txt_recordno.Text &
"'", Cn, 1, 4

Cn.Execute "INSERT into


HEDGEHOG_table(Code,Breed,Color,Gender,Age,PetFood,Cage,DateRcv,Birthday,Medicine,Price,Picture
) values('" & SOLD.Text1.Text & "','" & SOLD.Text2.Text & "','" & SOLD.Text3.Text & "','" &
SOLD.Text4.Text & "','" & SOLD.Text5.Text & "','" & SOLD.Text6.Text & "','" & SOLD.Text7.Text & "','"
&SOLD.Text8.Text & "','" & SOLD.Text9.Text & "','" & SOLD.text10.Text & "','" & SOLD.Text11.Text & "', '"
& SOLD.path.Caption & "')"

Cn.Execute "DELETE from Sold_table where Recordno like '" & SOLD.txt_recordno.Text & "' "
MsgBox "ITEM RETURN SUCCESFUL", vbOKOnly, ":)"
Unload Me

Else
If Combo1.Text = "RABBIT" Then
If Cn.State = 1 Then Cn.Close
conndb
Rs.Open "select count(Recordno) as cnt from Sold_table where code like '" & SOLD.txt_recordno.Text &
"'", Cn, 1, 4

Cn.Execute "INSERT into


RABBIT_table(Code,Breed,Color,Gender,Age,PetFood,Cage,DateRcv,Birthday,Medicine,Price,Picture)
values('" & SOLD.Text1.Text & "','" & SOLD.Text2.Text & "','" & SOLD.Text3.Text & "','" &
SOLD.Text4.Text & "','" & SOLD.Text5.Text & "','" & SOLD.Text6.Text & "','" & SOLD.Text7.Text & "','" &
SOLD.Text8.Text & "','" & SOLD.Text9.Text & "','" & SOLD.text10.Text & "','" & SOLD.Text11.Text & "', '"
& SOLD.path.Caption & "')"

Cn.Execute "DELETE from Sold_table where Recordno like '" & SOLD.txt_recordno.Text & "' "

MsgBox "ITEM RETURN SUCCESFUL", vbOKOnly, ":)"


Unload Me

Else
If Combo1.Text = "HAMSTER" Then

If Cn.State = 1 Then Cn.Close


conndb
Rs.Open "select count(Recordno) as cnt from Sold_table where code like '" & SOLD.txt_recordno.Text &
"'", Cn, 1, 4

Cn.Execute "INSERT into


HAMSTER_table(Code,Breed,Color,Gender,Age,PetFood,Cage,DateRcv,Birthday,Medicine,Price,Picture)

PETSHOP INVENTORY SYSTEM Page 101


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

values('" & SOLD.Text1.Text & "','" & SOLD.Text2.Text & "','" & SOLD.Text3.Text & "','" &
SOLD.Text4.Text & "','" & SOLD.Text5.Text & "','" & SOLD.Text6.Text & "','" & SOLD.Text7.Text & "','" &
SOLD.Text8.Text & "','" & SOLD.Text9.Text & "','" & SOLD.text10.Text & "','" & SOLD.Text11.Text & "', '"
& SOLD.path.Caption & "')"

Cn.Execute "DELETE from Sold_table where Recordno like '" & SOLD.txt_recordno.Text & "' "

MsgBox "ITEM RETURN SUCCESFUL", vbOKOnly, ":)"


Unload Me
End If
End If
End If
End If
End If
End If
End If
End Sub

PETSHOP INVENTORY SYSTEM Page 102


Datamex Institute of Computer Technology
2/F Aurello Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

MIKEE S. DEVERA
C-4 Road Tañong Malabon City
09489067196
mikee1993@yahoo.com

OBJECTIVES

A Position as an active employee, involving responsibility and working w/


others as a team member to achieve enhancement and growth for the company.

EDUCATIONAL ATTAINMENT
TERTIARY
Datamex Institute of Computer Technology
Information Technology
2012-2014
HIGH SCHOOL
Tañong National High School
2006-2010
Elementary
Tañong Elementary School Unit 1
2000-2006

TRAINING / WORKSHOP ATTENDED

BIR- Malabon-Navotas Branch


July 2013- October 2013
OJT (On the Job Training)
Encoding, confiling files and receipt, assisting taxpayers

SEMINARS ATTENTED

How to Become a Better Communicator


Theme: “Be Globally Competitive Have Great Communication Skills”
October 18, 2013
Datamex Caloocan

PETSHOP INVENTORY SYSTEM Page 103


Datamex Institute of Computer Technology
2/F Aurelio Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Functional Approach for Proper Pronunciation


Theme: “Guide for Speaking Distinctively”
October 19, 2013
Datamex Caloocan

PERSONAL INFORMATION

Age: 20
Date of Birth: June 4, 1993
Place of birth: Malabon City
Religion: Catholic
Civil Status: Single
Height: 4”11
Gender: Female
Mother`s Name: Moneth Sarmiento
Father`s Name: Romeo De vera
Citizenship: Filipino

SPECIAL SKILL:

 Computer literate (Microsoft Office, Power Point , Macro Media Flash)


CHARACTER REFERENCES

Jun Buenaventura Elena Gaon


Brgy. Captain Government Employee
Malabon City Malabon City

I hereby authorized that above information is true and correct.

MIKEE S. DEVERA
Signature

PETSHOP INVENTORY SYSTEM Page 104


Datamex Institute of Computer Technology
2/F Aurelio Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

Lea Anne R. Lucena


219 Sitio Mendez Area 5 Ext. Baesa Quezon City
Contact No:09071104791/09074819355
Bhoszlea_09@yahoo.com
OBJECTIVE:
A Position as an active employee, involving responsibility and working w/ others
as a team member to achieve enhancement and growth for the company.

PERSONAL DATA:
Provincial Address : Daja Norte, Banga,Aklan
Age : 18years old
Date of Birth : September 25,1995
Place of Birth : Quezon City
Height : 5’1’
Weight : 110 lbs
Religion : Roman Catholic
Civil Status : Single
Citizenship : Filipino
Gender : Female
Father’s Name : Flarry R. Lucena
Occupation : Company Driver
Mother’s Name : Rodina Lucena
Occupation : Housewefe
Language Spoken : Tagalog, English,Bisaya
Person to be contact in case of emergence : Rodina Lucena
Contact No : 09197598969

EDUCATIONAL BACKGROND:
PRIMARY : Daja Norte Elementary School
Daja Norte,Banga, Aklan
S.Y.2007-2008
SECONDARY : Ismael Mathay Sr. High School
GSIS Village Sangandaan Quezon City
S.Y.2011-2012
TERTIARY : Datamex School of Science and Technology
2ND Flr. Aurello Bldg. III cor. Rizal Ave.
Ext. 11TH Ave . Caloocan.City
2013-Present

PETSHOP INVENTORY SYSTEM Page 105


Datamex Institute of Computer Technology
2/F Aurelio Building, 3 Rizal Avenue Extension Corner 11th Avenue,
Caloocan City, Metro Manila

WORK EXPERENCE:

BIR- Malabon-Navotas Branch


July 2013- October 2013
OJT (On the Job Training)
Encoding, confiling files and receipt, assisting taxpayers

SEMINARS ATTENDED:

How to Become a Better Communicator


Theme: “Be Globally Competitive Have Great Communication Skills”
October 18, 2013
Datamex Caloocan

Functional Approach for Proper Pronunciation


Theme: “Guide for Speaking Distinctively”
October 19, 2013
Datamex Caloocan

CHARACTER REFERENCE:

ED Juan BRGY. CAPITAN Baesa Q.C.


Fernan Espeña BPSO Baesa Q.C.

I, hereby declare that all the information I heve given are and correct to the best of my
knowledge and belief.

LEA ANNE R.LUCENA


SIGNATURE

PETSHOP INVENTORY SYSTEM Page 106

You might also like