Next Chapter 30 Certificate
Dim rst As New ADODB.Recordset
Private Sub chameleonButton2_Click()
Unload Me
registration.Enabled = True
End Sub
Private Sub chameleonButton6_Click()
On Error GoTo ErHand
If Option1.Value = True Then
CertificateReport.Sections(1).Controls.Item("Label1").Caption = "BIRTH CERTIFICATE"
CertificateReport.Sections(1).Controls.Item("Label2").Caption = Label11.Caption
CertificateReport.Sections(1).Controls.Item("Label3").Caption = Text13.Text
CertificateReport.Sections(1).Controls.Item("Label4").Caption = Label12.Caption
CertificateReport.Sections(1).Controls.Item("Label5").Caption = Text14.Text
'CertificateReport.Sections(1).Controls.Item("Label6").Caption = Label13.Caption
CertificateReport.Sections(1).Controls.Item("Label7").Caption = Text15.Text
CertificateReport.Sections(1).Controls.Item("Label8").Caption = Label14.Caption
CertificateReport.Sections(1).Controls.Item("Label9").Caption = Text16.Text
CertificateReport.Sections(1).Controls.Item("Label10").Caption = Label15.Caption
CertificateReport.Sections(1).Controls.Item("Label11").Caption = Text17.Text
CertificateReport.Sections(1).Controls.Item("Label12").Caption = Label16.Caption
CertificateReport.Sections(1).Controls.Item("Label13").Caption = Text18.Text
CertificateReport.Sections(1).Controls.Item("Label14").Caption = Label17.Caption
CertificateReport.Sections(1).Controls.Item("Label15").Caption = Text19.Text
CertificateReport.Sections(1).Controls.Item("Label16").Caption = Label19.Caption
CertificateReport.Sections(1).Controls.Item("Label17").Caption = Text21.Text
CertificateReport.Sections(1).Controls.Item("Label18").Caption = Label20.Caption
CertificateReport.Sections(1).Controls.Item("Label19").Caption = Text20.Text
CertificateReport.Sections(1).Controls.Item("label57").Caption = hos_name
CertificateReport.Sections(1).Controls.Item("label58").Caption = hos_add
CertificateReport.Show
End If
If Option3.Value = True Then
MedicalCertificate.Sections(1).Controls.Item("Label3").Caption = "MEDICAL CERTIFICATE"
MedicalCertificate.Sections(1).Controls.Item("Label4").Caption = Label2.Caption
MedicalCertificate.Sections(1).Controls.Item("Label5").Caption = Text3.Text
'MedicalCertificate.Sections(1).Controls.Item("Label6").Caption = Label3.Caption
MedicalCertificate.Sections(1).Controls.Item("Label7").Caption = Text6.Text
MedicalCertificate.Sections(1).Controls.Item("Label8").Caption = Label4.Caption
MedicalCertificate.Sections(1).Controls.Item("Label9").Caption = Text7.Text
MedicalCertificate.Sections(1).Controls.Item("Label10").Caption = Label5.Caption
MedicalCertificate.Sections(1).Controls.Item("Label11").Caption = Text8.Text
MedicalCertificate.Sections(1).Controls.Item("Label12").Caption = Label6.Caption
MedicalCertificate.Sections(1).Controls.Item("Label13").Caption = Text9.Text
MedicalCertificate.Sections(1).Controls.Item("Label14").Caption = Label7.Caption
MedicalCertificate.Sections(1).Controls.Item("Label15").Caption = Text10.Text
MedicalCertificate.Sections(1).Controls.Item("Label16").Caption = Label8.Caption
MedicalCertificate.Sections(1).Controls.Item("Label17").Caption = Label9.Caption
MedicalCertificate.Sections(1).Controls.Item("Label18").Caption = Text11.Text
MedicalCertificate.Sections(1).Controls.Item("Label19").Caption = Label10.Caption
MedicalCertificate.Sections(1).Controls.Item("Label20").Caption = Text12.Text
MedicalCertificate.Sections(1).Controls.Item("Label1").Caption = hos_name
MedicalCertificate.Sections(1).Controls.Item("Label2").Caption = hos_add
MedicalCertificate.Show
End If
If Option4.Value = True Then
FitNessCertificate.Sections(1).Controls.Item("Label15").Caption = "FITNESS CERTIFICATE"
FitNessCertificate.Sections(1).Controls.Item("Label3").Caption = label18.Caption
FitNessCertificate.Sections(1).Controls.Item("Label4").Caption = Text22.Text
'FitNessCertificate.Sections(1).Controls.Item("Label5").Caption = Label21.Caption
FitNessCertificate.Sections(1).Controls.Item("Label6").Caption = Text23.Text
FitNessCertificate.Sections(1).Controls.Item("Label7").Caption = Label23.Caption
FitNessCertificate.Sections(1).Controls.Item("Label8").Caption = Text24.Text
FitNessCertificate.Sections(1).Controls.Item("Label9").Caption = Label24.Caption
FitNessCertificate.Sections(1).Controls.Item("Label10").Caption = Text25.Text
FitNessCertificate.Sections(1).Controls.Item("Label1").Caption = hos_name
FitNessCertificate.Sections(1).Controls.Item("Label2").Caption = hos_add
FitNessCertificate.Show
End If
If Option2.Value = True Then
DeathCertificate.Sections(1).Controls.Item("Label5").Caption = Text27.Text
DeathCertificate.Sections(1).Controls.Item("Label7").Caption = Text28.Text
DeathCertificate.Sections(1).Controls.Item("Label9").Caption = Text29.Text
DeathCertificate.Sections(1).Controls.Item("Label11").Caption = Text30.Text
DeathCertificate.Sections(1).Controls.Item("Label14").Caption = Text31.Text
DeathCertificate.Sections(1).Controls.Item("Label17").Caption = Text32.Text
DeathCertificate.Sections(1).Controls.Item("Label18").Caption = Text33.Text
DeathCertificate.Sections(1).Controls.Item("Label1").Caption = hos_name
DeathCertificate.Sections(1).Controls.Item("Label1").Caption = hos_add
DeathCertificate.Show
End If
ErHand:
ErrHandler "Bills.ChameleonButton6_Click() [Print]"
End Sub
Private Sub Form_Load()
Me.Top = (MDIForm1.ScaleHeight - Me.Height) / 2
Me.Left = 2900
Text2 = registration.txtRegNo
Call Text2_LostFocus
End Sub
Private Sub Form_Unload(Cancel As Integer)
registration.Enabled = True
End Sub
Private Sub Option1_Click()
Frame6.Visible = False
Frame2.Visible = False
Frame7.Visible = False
Frame5.Visible = True
End Sub
Private Sub Option2_Click()
Frame5.Visible = False
Frame6.Visible = False
Frame2.Visible = False
Frame7.Visible = True
End Sub
Private Sub Option3_Click()
Frame6.Visible = False
Frame7.Visible = False
Frame5.Visible = False
Frame2.Visible = True
End Sub
Private Sub Option4_Click()
Frame2.Visible = False
Frame5.Visible = False
Frame7.Visible = False
Frame6.Visible = True
End Sub
Private Sub Text2_KeyPress(KeyAscii As Integer)
If (KeyAscii >= vbKey0 And KeyAscii <= vbKey9) Or KeyAscii = vbKeyBack Or (KeyAscii = 46) Then
Exit Sub
Else
KeyAscii = 0
Beep
End If
End Sub
Private Sub Text2_LostFocus()
On Error GoTo ErHand
If Text2 = "" Then Exit Sub
Set rst = New ADODB.Recordset
rst.Open "select * from Hospital where registration = " & Val(Text2) & "", Conn, adOpenDynamic, adLockOptimistic
If rst.EOF = True Then
MsgBox "No Record Matched with Registartion No.", vbInformation
rst.Close
Exit Sub
Else
Text13 = rst!Title & " " & rst!first_name & " " & rst!middle_name & " " & rst!last_name & ""
Text27 = rst!Title & " " & rst!first_name & " " & rst!middle_name & " " & rst!last_name & ""
Text22 = rst!Title & " " & rst!first_name & " " & rst!middle_name & " " & rst!last_name & ""
Text3 = rst!Title & " " & rst!first_name & " " & rst!middle_name & " " & rst!last_name & ""
Text14 = rst!religion
Text15 = rst!FATHER_NAME
Text28 = rst!FATHER_NAME
Text23 = rst!FATHER_NAME
Text6 = rst!FATHER_NAME
Text16 = rst!street & " " & rst!City & " "
End If
rst.Close
'admission
Set rst = New ADODB.Recordset
rst.Open "select * from addmission where refno = " & Val(Text2) & "", Conn, adOpenDynamic, adLockOptimistic
If rst.EOF = False Then
Text7 = rst!doa
Text8.Text = rst!aot
Text9 = rst!dod & ""
Text10 = rst!dot & ""
Text29 = rst!doa
Text30 = rst!aot & ""
Text24 = rst!doa
End If
rst.Close
ErHand:
ErrHandler "Bills.Text2_LostFocus()"
End Sub
Sponsored Links