venu_resoju
Registered User.
- Local time
- Tomorrow, 01:04
- Joined
- Dec 29, 2010
- Messages
- 129
What's wrong with me please any body help me.
What's wrong with me please any body help me.Private Sub Save_Click()
If IsNull(cboEmpName) Then
MsgBox "Please Select Employee Name"
Me.cboEmpName.SetFocus
End If
If Me.txtNoofDaysWorked.Value = "0" Then
MsgBox "Please Enter No of Worked Days"
End If
Dim db As DAO.Database
Dim rst1 As DAO.Recordset
Dim rst2 As DAO.Recordset
Set db = CurrentDb
Set rst1 = db.OpenRecordset("Payroll")
If rst1.EOF Then ' No records
rst1.AddNew
Else
rst1.Edit ' record exist
End If
rst1!PayrollID = Me!txtPayrollID
rst1!EmpID = Me!txtEmpID
rst1!EmpName = Me!cboEmpName.Column(1)
rst1!EPFNo = Me!txtEPFNo
rst1!ESINo = Me!txtESINo
rst1!NetPay = Me.txtNetPay
rst1!AdvanceBalance = Me.txtAdvRemaining
rst1.Update
rst1.Close
If Me.txtAdvance > 0 Then
Set rst2 = db.OpenRecordset("LoanTransactions")
If rst2.EOF Then ' No records
rst2.AddNew
Else
rst2.Edit ' record exist
End If
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