for Edit and Update what changes are required

mercredi 18 mars 2015

Hello all my dear friends,



I have a code for save button, but it is not working for "EDIT" and "UPDATE" the records. what changes are required in the below code for "EDIT"and "UPDATE" options. friends please help me for this.


Quote:










Private Sub Command87_Click()



Dim db As DAO.Database



Dim rst1 As DAO.Recordset

Dim rst2 As DAO.Recordset



Set db = CurrentDb



Set rst1 = db.OpenRecordset("Payroll")



rst1.AddNew



rst1!PayrollID = Me!txtPayrollID

rst1!EmpID = Me!txtEmpID

rst1!EmpName = Me!cboEmpName.Column(1)

rst1!EPFNo = Me!txtEPFNo

rst1!ESINo = Me!txtESINo

rst1!PayPeriod = Me.cbomonth & "-" & Me.cboYear

rst1!WageRate = Me!txtwagerate + Me.txtVDA

rst1!OtherRate = Me!txtOtherRate

rst1!WorkingDays = Me!txtWorkingDays

rst1!NoofDaysWorked = Me!txtNoofDaysWorked

rst1!PH = Me.txtNoofPaidHolidays

rst1!TotalOTHrs = Me!txtOTHrs

rst1!CalcOTHrs = Me.txtcalcOTHrs

rst1!Basic = Me.txtBasic

rst1!PHPay = Me.txtPH

rst1!OTAmount = Me.txtOT

rst1!Medical = Me.txtMedc

rst1!TA = Me.txtTA

rst1!DA = Me.txtDA

rst1!HRA = Me.txtHRA

rst1!Other = Me.txtOtherA

rst1!EPF = Me.txtEPFD

rst1!ESI = Me.txtESID

rst1!CT = Me.txtCT

rst1!Advance = Me.txtAdvance

rst1!OtherDeductions = Me.txtOtherD

rst1!NetPay = Me.txtNetPay

rst1!AdvanceBalance = Me.txtAdvRemaining



rst1.Update

rst1.Close



If Me.txtAdvance > 0 Then

Set rst2 = db.OpenRecordset("LoanTransactions")



rst2.AddNew



rst2!EmpName = Me!cboEmpName.Column(1)

rst2!TransnDate = Date

rst2!TransnType = "Deduction"

rst2!Sanctions = "0"

rst2!Deductions = Me.txtAdvance

rst2!LoanName = "Salary Deduction"

rst2.Update



rst2.Close

Set rst2 = Nothing



End If



Call ClearControls



End Sub



please help me friends, I am learning the access from few days.



Thanking you all

for Edit and Update what changes are required

0 commentaires:

Enregistrer un commentaire

Labels