This is a known problem with Access 2002 SP3. This particular version/patch
reports the "No Current Record" error immediately after the deletion, and
then sorts itself out again quickly.
Temporarily comment out the error handler, and get the actual number for the
error. Then change the error handling part of the routine so it just ignores
this error, i.e.:
If Err.Number <> xxxx Then
MsgBox ...
End If
What the wizard code does is fire off the 9th item on the Edit menu in A95
(the first record is zero), which is Select Record. Then it fires the 7th
item on the Edit menu, which is the Delete.
A better way to code this would be:
RunCommand acCmdDeleteRecord
However, I suspect this will still strike the same bug in this
version/patch.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"dicej" <(E-Mail Removed)> wrote in message
news:632D10DA-3021-4D0A-B661-(E-Mail Removed)...
>I created my database in Access 2000 and my company recently upgraded to
> 2002. Certain people are still using 2000 in my organization however so I
> don't want to convert my db yet.
>
> Problem: I have a button on a form that the button wizard set up to
> delete
> a record. Previously it worked fine.
>
> While it still deletes the active record on my form, it now also gives an
> error message that says "No current record." This appears after the
> record
> is deleted.
>
> The VBA code that the wizard created is:
> DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
> DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
>
> I know those numbers refer to Access 95 commands but I don't know what
> they
> are. I still haven't figured out VBA very well...
>
> Curiously, if I select Delete Record from the menu, the error message
> doesn't appear so the code is not the same.
>
> How can I stop that error message from appearing?
> Thanks
>
>