No Current Record

E

Ed

Hello.. I have a form with a subform for editing records in two tables (the tables have cascading relationships to delete). On this form I have a command button to delete records. When I delete a record, I get an Access message box indicating "No Current Record". I have not been able to figure out why.. any ideas? Thanks
 
E

Ed

----- Ed wrote: ----

Hello.. I have a form with a subform for editing records in two tables (the tables have cascading relationships to delete). On this form I have a command button to delete records. When I delete a record, I get an Access message box indicating "No Current Record". I have not been able to figure out why.. any ideas? Thank

Also, I failed to mention: The record deletes properly and the previous record then displays correctly... It is the message box that is at issue.
 
A

Allen Browne

If this is happening on Access 2002 with Service Pack 3 applied, just code
to ignore the error.

It is a known bug introduced by SP3.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Ed said:
----- Ed wrote: -----

Hello.. I have a form with a subform for editing records in two
tables (the tables have cascading relationships to delete). On this form I
have a command button to delete records. When I delete a record, I get an
Access message box indicating "No Current Record". I have not been able to
figure out why.. any ideas? Thanks
Also, I failed to mention: The record deletes properly and the previous
record then displays correctly... It is the message box that is at issue.
 
A

Allen Browne

Private Sub cmdDelete_Click()
On Error GoTo Err_cmdDelete_Click

RunCommand acCmdDeleteRecord

Exit_cmdDelete_Click:
Exit Sub

Err_cmdDelete_Click:
If Err.Number <> 3021 Then
MsgBox "Error " & Err.Number & " - " & Err.Description
End If
Resume Exit_cmdDelete_Click
End Sub


For an explanation of error handling routines, see:
http://allenbrowne.com/ser-23a.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top