Private Sub Command1_Click()
Dim b As String
b = " هذا أجمالي السحب لجميع الموظفين "
Select Case Combo1.ListIndex
Case 0
Adodc1.RecordSource = "select *from stor where no_job=" & Val(Text1.Text)
Adodc1.Refresh
Adodc2.RecordSource = "select sum(op),sum(do),sum(cheke),sum(teeth),sum(eye),sum(bayby),sum(ded),sum(out),sum(help),sum(hurt),sum(totel) from stor where no_job=" & Val(Text1.Text)
Adodc2.Refresh
If Val(Text3.Text) Or Val(Text4.Text) Or Val(Text5.Text) Or Val(Text6.Text) Or Val(Text7.Text) Or Val(Text8.Text) Or Val(Text9.Text) Or Val(Text10.Text) Or Val(Text11.Text) > 0 Then
S1 = Horof(Text3.Text)
S2 = Horof(Text2.Text)
S3 = Horof(Text7.Text)
S4 = Horof(Text8.Text)
S5 = Horof(Text9.Text)
S6 = Horof(Text10.Text)
S7 = Horof(Text13.Text)
S8 = Horof(Text11.Text)
S9 = Horof(Text4.Text)
S10 = Horof(Text5.Text)
S11 = Horof(Text6.Text)
Else
S1.Caption = "صفر ريال"
S2.Caption = "صفر ريال"
S3.Caption = "صفر ريال"
S4.Caption = "صفر ريال"
S5.Caption = "صفر ريال"
S6.Caption = "صفر ريال"
S7.Caption = "صفر ريال"
S8.Caption = "صفر ريال"
S9.Caption = "صفر ريال"
S10.Caption = "صفر ريال"
S11.Caption = "صفر ريال"
End If
Case 1
Adodc1.RecordSource = "select *from stor where name= '" & Text1.Text & "'"
Adodc1.Refresh
Adodc2.RecordSource = "select sum(op),sum(do),sum(cheke),sum(teeth),sum(eye),sum(bayby),sum(ded),sum(out),sum(help),sum(hurt),sum(totel) from stor where name= '" & Text1.Text & "'"
Adodc2.Refresh
If Val(Text3.Text) Or Val(Text4.Text) Or Val(Text5.Text) Or Val(Text6.Text) Or Val(Text7.Text) Or Val(Text8.Text) Or Val(Text9.Text) Or Val(Text10.Text) Or Val(Text11.Text) > 0 Then
S1 = Horof(Text3.Text)
S2 = Horof(Text2.Text)
S3 = Horof(Text7.Text)
S4 = Horof(Text8.Text)
S5 = Horof(Text9.Text)
S6 = Horof(Text10.Text)
S7 = Horof(Text13.Text)
S8 = Horof(Text11.Text)
S9 = Horof(Text4.Text)
S10 = Horof(Text5.Text)
S11 = Horof(Text6.Text)
Else
S1.Caption = "صفر ريال"
S2.Caption = "صفر ريال"
S3.Caption = "صفر ريال"
S4.Caption = "صفر ريال"
S5.Caption = "صفر ريال"
S6.Caption = "صفر ريال"
S7.Caption = "صفر ريال"
S8.Caption = "صفر ريال"
S9.Caption = "صفر ريال"
S10.Caption = "صفر ريال"
S11.Caption = "صفر ريال"
End If
Case 2
Adodc1.RecordSource = "select *from stor where no_bil=" & Val(Text1.Text)
Adodc1.Refresh
Adodc2.RecordSource = "select sum(op),sum(do),sum(cheke),sum(teeth),sum(eye),sum(bayby),sum(ded),sum(out),sum(help),sum(hurt),sum(totel) from stor where no_bil=" & Val(Text1.Text)
Adodc2.Refresh
If Val(Text3.Text) Or Val(Text4.Text) Or Val(Text5.Text) Or Val(Text6.Text) Or Val(Text7.Text) Or Val(Text8.Text) Or Val(Text9.Text) Or Val(Text10.Text) Or Val(Text11.Text) > 0 Then
S1 = Horof(Text3.Text)
S2 = Horof(Text2.Text)
S3 = Horof(Text7.Text)
S4 = Horof(Text8.Text)
S5 = Horof(Text9.Text)
S6 = Horof(Text10.Text)
S7 = Horof(Text13.Text)
S8 = Horof(Text11.Text)
S9 = Horof(Text4.Text)
S10 = Horof(Text5.Text)
S11 = Horof(Text6.Text)
Else
S1.Caption = "صفر ريال"
S2.Caption = "صفر ريال"
S3.Caption = "صفر ريال"
S4.Caption = "صفر ريال"
S5.Caption = "صفر ريال"
S6.Caption = "صفر ريال"
S7.Caption = "صفر ريال"
S8.Caption = "صفر ريال"
S9.Caption = "صفر ريال"
S10.Caption = "صفر ريال"
S11.Caption = "صفر ريال"
End If
Case 3
Adodc1.RecordSource = "select *from stor where on_Card=" & Val(Text1.Text)
Adodc1.Refresh
Adodc2.RecordSource = "select sum(op),sum(do),sum(cheke),sum(teeth),sum(eye),sum(bayby),sum(ded),sum(out),sum(help),sum(hurt),sum(totel) from stor where on_Card=" & Val(Text1.Text)
Adodc2.Refresh
Text14.Text = Text14.Text + Text1.Text
If Val(Text3.Text) Or Val(Text4.Text) Or Val(Text5.Text) Or Val(Text6.Text) Or Val(Text7.Text) Or Val(Text8.Text) Or Val(Text9.Text) Or Val(Text10.Text) Or Val(Text11.Text) > 0 Then
S1 = Horof(Text3.Text)
S2 = Horof(Text2.Text)
S3 = Horof(Text7.Text)
S4 = Horof(Text8.Text)
S5 = Horof(Text9.Text)
S6 = Horof(Text10.Text)
S7 = Horof(Text13.Text)
S8 = Horof(Text11.Text)
S9 = Horof(Text4.Text)
S10 = Horof(Text5.Text)
S11 = Horof(Text6.Text)
Else
S1.Caption = "صفر ريال"
S2.Caption = "صفر ريال"
S3.Caption = "صفر ريال"
S4.Caption = "صفر ريال"
S5.Caption = "صفر ريال"
S6.Caption = "صفر ريال"
S7.Caption = "صفر ريال"
S8.Caption = "صفر ريال"
S9.Caption = "صفر ريال"
S10.Caption = "صفر ريال"
S11.Caption = "صفر ريال"
End If
Case 4
Adodc1.RecordSource = "select *from stor;"
Adodc1.Refresh
Adodc2.RecordSource = "select sum(op),sum(do),sum(cheke),sum(teeth),sum(eye),sum(bayby),sum(ded),sum(out),sum(help),sum(hurt),sum(totel) from stor;"
Adodc2.Refresh
Text14.Text = b
If Val(Text3.Text) Or Val(Text4.Text) Or Val(Text5.Text) Or Val(Text6.Text) Or Val(Text7.Text) Or Val(Text8.Text) Or Val(Text9.Text) Or Val(Text10.Text) Or Val(Text11.Text) > 0 Then
S1 = Horof(Text3.Text)
S2 = Horof(Text2.Text)
S3 = Horof(Text7.Text)
S4 = Horof(Text8.Text)
S5 = Horof(Text9.Text)
S6 = Horof(Text10.Text)
S7 = Horof(Text13.Text)
S8 = Horof(Text11.Text)
S9 = Horof(Text4.Text)
S10 = Horof(Text5.Text)
S11 = Horof(Text6.Text)
Else
S1.Caption = "صفر ريال"
S2.Caption = "صفر ريال"
S3.Caption = "صفر ريال"
S4.Caption = "صفر ريال"
S5.Caption = "صفر ريال"
S6.Caption = "صفر ريال"
S7.Caption = "صفر ريال"
S8.Caption = "صفر ريال"
S9.Caption = "صفر ريال"
S10.Caption = "صفر ريال"
S11.Caption = "صفر ريال"
End If
End Select
End Sub