G
Guest
Hi All,
I have a problem of adding records into table, if the cursor is on the first
record the record that I add replaces the first record and then I moved it to
the last record and the new record replaces that last record in the table.
Is there a method that I can use to make sure this doesn't happen. The thing
is my program was working fine until recently, as I have about 197 records in
that table. Can someone please rescue me.
this is the code that I use to add the record:
On Error GoTo AddErr
With rsemp
If bAddNew Then .AddNew
!empnum = txtEmpNum
!EmpDeptId = cboDept.ItemData(cboDept.ListIndex)
!Title = cboTitle
!lastname = txtLastName
!firstname = txtFirstName
!offloc = cboOffLoc
!officenum = txtOffNum
!OffPhone = Me.txtPhone
!email = txtEmail
.Save
End With
cmdAdd.Enabled = True
cmdSave.Enabled = False
Exit Sub
AddErr:
MsgBox "there was an error " & Err.Number & " " & Err.Description
End Sub
I have a problem of adding records into table, if the cursor is on the first
record the record that I add replaces the first record and then I moved it to
the last record and the new record replaces that last record in the table.
Is there a method that I can use to make sure this doesn't happen. The thing
is my program was working fine until recently, as I have about 197 records in
that table. Can someone please rescue me.
this is the code that I use to add the record:
On Error GoTo AddErr
With rsemp
If bAddNew Then .AddNew
!empnum = txtEmpNum
!EmpDeptId = cboDept.ItemData(cboDept.ListIndex)
!Title = cboTitle
!lastname = txtLastName
!firstname = txtFirstName
!offloc = cboOffLoc
!officenum = txtOffNum
!OffPhone = Me.txtPhone
!email = txtEmail
.Save
End With
cmdAdd.Enabled = True
cmdSave.Enabled = False
Exit Sub
AddErr:
MsgBox "there was an error " & Err.Number & " " & Err.Description
End Sub