(Access & SQL) |
+ |
Private Sub cmd_add_Click() On Error GoTo Er Dim idpath As String idpath = Forms![gamokvleva_add]![idpatient_history] Dim t As String p = "proc_dmax_nomer_baza @idpathistory=" & idpath Call MAXCOUNT("sproc_dmax_nomer_baza", p, pmax) t = pmax + 1 If (Forms![gamokvleva_add]![check_other] = -1) Then p = "proc_insert_baza_1 @idpathistory=" & idpath & ", @nomer=" & t & ", @idregtest=" & Me.id_registration_test Call PROC("sproc_insert_baza_1", p, 0) Else p = "proc_insert_baza_2 @idpathistory=" & idpath & ", @nomer=" & t & ", @idregtest=" & Me.id_registration_test Call PROC("sproc_insert_baza_2", p, 0) End If If Forms![gamokvleva_add]![numsqesi] = 1 Then p = "proc_insert_bazapatienttests_1 @idpathistory=" & idpath & ", @idregtest=" & Me.id_registration_test Call PROC("sproc_insert_bazapatienttests_1", p, 0) Else p = "proc_insert_bazapatienttests_2 @idpathistory=" & idpath & ", @idregtest=" & Me.id_registration_test Call PROC("sproc_insert_bazapatienttests_2", p, 0) End If Dim dsumma As Currency p = "proc_summa_idpathistory_fasi @idpathistory=" & idpath Call MAXCOUNT("sproc_summa_idpathistory_fasi", p, pmax) dsumma = pmax Dim t1 As Currency t1 = Nz(dsumma) - (Nz(dsumma) * (Nz(Forms![registratura_newedit]![procent]))) / 100 p = "proc_update_patienthistory_6 @idpathistory=" & idpath & ", @salaro=" & str(t1) Call PROC("sproc_update_patienthistory_6", p, 0) Forms![registratura_newedit]![registratura_newedit_subform].Form.Requery Forms![registratura_newedit]![registratura_newedit_subform].Visible = True Forms![registratura_newedit].Form.Requery Ex: Exit Sub Er: MsgBox Err.Description Resume Ex End Sub |
+ |
Private Sub procent_AfterUpdate() Dim t As Currency t = Nz(Me.sumtests) - (Nz(Me.sumtests) * (Nz(Me.procent))) / 100 Me.salaros_tanxa = str(t) Me.baratis_tanxa = 0 Call MONACEMEBI End Sub Function UPDATO() If IsNull(id_eqimi) Then p = "proc_update_patienthistory_visit @idpatient=" & Me.id_patient & "," _ & " @idpathistory=" & Me.id_patient_history & "," _ & " @ideqimi=Null," _ & " @procento=" & Me.procent & "," _ & " @salarostanxa=" & Nz(Me.salaros_tanxa, 0) & "," _ & " @baratistanxa=" & Nz(Me.baratis_tanxa, 0) & "," _ & " @fasdaklebistanxa=" & Nz(Me.fasdaklebis_tanxa, 0) Else p = "proc_update_patienthistory_visit @idpatient=" & Me.id_patient & "," _ & " @idpathistory=" & Me.id_patient_history & "," _ & " @ideqimi=" & Me.id_eqimi & "," _ & " @procento=" & Me.procent & "," _ & " @salarostanxa=" & Nz(Me.salaros_tanxa, 0) & "," _ & " @baratistanxa=" & Nz(Me.baratis_tanxa, 0) & "," _ & " @fasdaklebistanxa=" & Nz(Me.fasdaklebis_tanxa, 0) End If Call PROC("[sproc_update_patienthistory_visit]", p, 0) End Function Function MONACEMEBI() Call UPDATO p = "proc_select_baza @idpathistory=" & Me.id_patient_history Call PROC("sproc_select_baza", p, 1) Me.registratura_newedit_subform.Form.RecordSource = "sproc_select_baza" Me.registratura_newedit_subform.Form.Requery End Function |
http://www.sql.ru/forum/1265885/zapis-chisla-v-pole-access-sql