Documents

Trans Code

Description
Description:
Categories
Published
of 6
All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Share
Transcript
  ''Public ctr As Integer''Private Sub cbobloodgroup_Click()''cboid.ListIndex = cbobloodgroup.ListIndex''Dim rsstock As New ADODB.Recordset''If rsstock.State Then rsstock.Close''Dim strsqlstock As String''strsqlstock = Select AvailableQty From BloodGroup Where PK_BloodGroupID= & Val(cboid.Text)''rsstock.Open strsqlstock, cnn, adOpenDynamic, adLockOptimistic'''' lblstockdon.Caption = rsstock( AvailableQty )''''End Sub''''Private Sub cbobloodgroup_KeyPress(KeyAscii As Integer)''Select Case KeyAscii''Case Else''KeyAscii = 0''End Select''''End Sub''''Private Sub cbobloodgroup1_Click()''cboid1.ListIndex = cbobloodgroup1.ListIndex''Dim rsstock As New ADODB.Recordset''If rsstock.State Then rsstock.Close''Dim strsqlstock As String''strsqlstock = Select AvailableQty From BloodGroup Where PK_BloodGroupID= & Val(cboid1.Text)''rsstock.Open strsqlstock, cnn, adOpenDynamic, adLockOptimistic'''' lblstockout.Caption = rsstock( AvailableQty )''''End Sub''''''''Private Sub cbobloodgroup2_Click()''cboid2.ListIndex = cbobloodgroup2.ListIndex''Dim rsstock As New ADODB.Recordset''If rsstock.State Then rsstock.Close''Dim strsqlstock As String''strsqlstock = Select AvailableQty From BloodGroup Where PK_BloodGroupID= & Val(cboid2.Text)''rsstock.Open strsqlstock, cnn, adOpenDynamic, adLockOptimistic'''' lblstock.Caption = rsstock( AvailableQty )''''''End Sub''''Public Function filldonid()''Dim rsd As New ADODB.Recordset''With rsd'' If rsd.State Then rsd.Close'' .Open IndividualMaster , cnn, adOpenDynamic, adLockOptimistic'' Dim i As Integer'' For i = 1 To .RecordCount'' cbodonid.AddItem .Fields( PK_DonorID )  '' 'txtdonname.Text = rsd( DonorName )'' .MoveNext'' Next''End With''End Function''''''''''Private Sub cbodonid_Click()''Dim rsdname As New ADODB.Recordset''If rsdname.State Then rsdname.Close''rsdname.Open Select DonorName From IndividualMaster Where PK_DonorID= & Val(cbodonid.Text), cnn, adOpenDynamic, adLockOptimistic'' txtdonname.Text = rsdname( DonorName )''End Sub''''Private Sub cbodonid_KeyPress(KeyAscii As Integer)''Select Case KeyAscii''Case Else''KeyAscii = 0''End Select''''End Sub''''Private Sub cboreciepent_Click()''If cboreciepent.ListIndex = 0 Then'' fmoutsider.Visible = False'' fmhospital.Visible = False'' fmdon.Visible = True'' Call FillBloodgroupDonor'' Call filldonid''''End If''If cboreciepent.ListIndex = 1 Then'' fmdon.Visible = False'' fmhospital.Visible = False'' fmoutsider.Visible = True'' Call FillBloodgroupOutsider''End If''If cboreciepent.ListIndex = 2 Then'' fmoutsider.Visible = False'' fmdon.Visible = False'' fmhospital.Visible = True'' Call FillBloodgroupHosp'''' ctr = 1'' msfhosptrans.ColWidth(0) = 1'' msfhosptrans.ColWidth(1) = 1500'' msfhosptrans.ColWidth(2) = 1500'' msfhosptrans.TextMatrix(0, 0) = id '' msfhosptrans.TextMatrix(0, 1) = Blood Group '' msfhosptrans.TextMatrix(0, 2) = No of Bags ''''End If''End Sub''''Private Sub cmdCheck_Click()''If txtdonid.Text = Then  '' MsgBox Enter DonorID , vbInformation''Else''Dim ctr As Integer''Dim i, a As Integer''Dim did As Integer''did = Val(txtdonid.Text)''''Dim rsCheck As New ADODB.Recordset''rsCheck.Open Select * From IndividualMaster , cnn, adOpenDynamic, adLockOptimistic''i = 0''If rsCheck.RecordCount > 0 Then'' For ctr = 1 To rsCheck.RecordCount'' a = 0'' cbodonid.ListIndex = i'' a = Val(cbodonid.Text)'' If did = a Then'' lblAvailable.Caption = Available '' lblAvailable.ForeColor = &H8000& 'Green'' lblAvailable.Visible = True'' Exit Sub'' Else'' lblAvailable.Caption = Not Available '' lblAvailable.ForeColor = &HC0& 'Red'' End If'' 'a = a + 1'' i = i + 1'' Next''lblAvailable.Visible = True''If lblAvailable.Caption = Not Available Then'' MsgBox Donor is not register , vbCritical''End If''''End If''End If''End Sub''''Private Sub cmdcheckhosp_Click()''If txthospid.Text = Then'' MsgBox Enter HospitalID , vbInformation''Else''Dim ctr1 As Integer''Dim i1, a1 As Integer''Dim hid As Integer''hid = Val(txthospid.Text)''''Dim rshosp As New ADODB.Recordset''rshosp.Open Select * From HospitalMaster , cnn, adOpenDynamic, adLockOptimistic''i1 = 0''If rshosp.RecordCount > 0 Then'' For ctr1 = 1 To rshosp.RecordCount'' a1 = 0'' cbohospid.ListIndex = i1'' a1 = Val(cbohospid.Text)'' If hid = a1 Then'' lblavailablehosp.Caption = Available '' lblavailablehosp.ForeColor = &H8000& 'Green'' lblavailablehosp.Visible = True'' Exit Sub  '' Else'' lblavailablehosp.Caption = Not Available '' lblavailablehosp.ForeColor = &HC0& 'Red'' End If'' 'a = a + 1'' i1 = i1 + 1'' Next''lblavailablehosp.Visible = True''If lblavailablehosp.Caption = Not Available Then'' MsgBox Hospital is not register , vbCritical''End If''End If''End If''''End Sub''''Private Sub cmddonorexit_Click()''fmdon.Visible = False''End Sub''''Private Sub cmdexithosp_Click()''fmhospital.Visible = False''End Sub''''Private Sub cmdexitout_Click()''fmoutsider.Visible = False''End Sub''''Private Sub cmdOkData_Click()''If txtNOB.Text = Then'' MsgBox Enter No. of Bags , vbInformation''End If''If Val(txtNOB.Text) > Val(lblstock.Caption) Then'' MsgBox & Val(txtNOB.Text) & No. of Bags are not available , vbInformation'' txtNOB.Text = '' txtNOB.SetFocus''Else'' lblstock.Caption = Val(lblstock.Caption) - Val(txtNOB.Text)''End If'''' msfhosptrans.TextMatrix(ctr, 1) = cbobloodgroup2.Text'' msfhosptrans.TextMatrix(ctr, 2) = txtNOB.Text'' ctr = ctr + 1''''End Sub''''Private Sub cmdsave_Click()''Call recipent''Dim rsTrans As New ADODB.Recordset''If rsTrans.State Then rsTrans.Close''rsTrans.Open Select * From Transaction , cnn, adOpenDynamic, adLockOptimistic''rsTrans.AddNew'' If recp = 0 Then'' rsTrans( TypeOfReciepent ) = recp'' rsTrans( FK_RecepientID ) = cbodonid.Text'' rsTrans( NoOfBags ) = txtNOBDON.Text'' rsTrans( BloodGroupName ) = cbobloodgroup.Text'' rsTrans( TransactionDate ) = dtdon.Value
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks
SAVE OUR EARTH

We need your sign to support Project to invent "SMART AND CONTROLLABLE REFLECTIVE BALLOONS" to cover the Sun and Save Our Earth.

More details...

Sign Now!

We are very appreciated for your Prompt Action!

x