venu_resoju
Registered User.
- Local time
- Tomorrow, 02:30
- Joined
- Dec 29, 2010
- Messages
- 129
I have a form named "frmAttendance" which contain "EmpID", "EmpName", "EPFNo" and "AttendanceDate" and am using the below code to save it to "tblAttendance". It is working fine, but I want to add "Attendance Status" Option group(like"Present" & "Absent') and "OT Hrs" text box to the form. How can I include them in the below code to save to the 'tblAttendance" table.
and also DoCmd.GoToRecord , "", acNewRec is not working in the below code where is the problem, I didn;t understand...
please anybody help me to solve this...
Private Sub cmdSave_Click()
On Error GoTo cmdSave_Click_Err
On Error Resume Next
Dim db As Database
Dim rst As Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset("Customers")
rst.AddNew
rst!AttendanceDate = Me!txtAtDate
rst!EmpID = Me!Combo10
rst!EmpName = Me!txtEmpName
rst!EPFNo = Me!txtEPFNo
rst.Update
rst.Close
DoCmd.GoToRecord , "", acNewRec
cmdSave_Click_Exit:
Exit Sub
cmdSave_Click_Err:
MsgBox Error$
Resume cmdSave_Click_Exit
End Sub
and also DoCmd.GoToRecord , "", acNewRec is not working in the below code where is the problem, I didn;t understand...
please anybody help me to solve this...
Private Sub cmdSave_Click()
On Error GoTo cmdSave_Click_Err
On Error Resume Next
Dim db As Database
Dim rst As Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset("Customers")
rst.AddNew
rst!AttendanceDate = Me!txtAtDate
rst!EmpID = Me!Combo10
rst!EmpName = Me!txtEmpName
rst!EPFNo = Me!txtEPFNo
rst.Update
rst.Close
DoCmd.GoToRecord , "", acNewRec
cmdSave_Click_Exit:
Exit Sub
cmdSave_Click_Err:
MsgBox Error$
Resume cmdSave_Click_Exit
End Sub