Access pulling deleted record off screen before I actually delete

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form where I use a Delete Button to allow the user to delete a
record if it passes a serious of data checks etc.

My form is set to cycle current record.

I am using the Access commands for deletion:
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

What Access does is as soon as the user selects a record to delete, it pulls
that record off of my user form and it loads another record, so when the user
is prompted to see if they really want to delete, they are looking at the
wrong record. The record they don't see anymore is actually the one gets
deleted, but to the user it looks as though they are deleting a record that
they didn't select.

How can I stop this. I want the original record to stay on the form until
the user actually answers "Yes - Delete it".

Thanks for any help you can give.
 
I have never used DoMenuItem. I have an personal dislike for them. It is
too hard to read code because it is impossible to remember what each one
does. But, that is only my personal problem. Here is a way that gives you
more control and will do what you want:

If MsgBox("Do You Want to Delete This Record", vbQuestion + vbYesNo) = vbYes
Then
Application.Echo False
With Me
Set rst = .RecordsetClone
rst.Bookmark = .Bookmark
If .Recordset.AbsolutePosition > 0 Then
.Recordset.MoveNext
Else
.Recordset.MovePrevious
End If
rst.Delete
If .Recordset.AbsolutePosition > 0 Then
.Recordset.MovePrevious
Else
.Recordset.MoveNext
End If
End With
Application.Echo True
End If
 
U¿ytkownik "KmhComputer said:
I have a form where I use a Delete Button to allow the user to delete a
record if it passes a serious of data checks etc.

My form is set to cycle current record.

I am using the Access commands for deletion:
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70

What Access does is as soon as the user selects a record to delete, it pulls
that record off of my user form and it loads another record, so when the user
is prompted to see if they really want to delete, they are looking at the
wrong record. The record they don't see anymore is actually the one gets
deleted, but to the user it looks as though they are deleting a record that
they didn't select.

How can I stop this. I want the original record to stay on the form until
the user actually answers "Yes - Delete it".

Thanks for any help you can give.


============================================================================
================
FULL LEGAL SOFTWARE !!!
Games, video, program, image, chat, questbook, catalog site, arts, news,
and...
This site it is full register and legal software !!!
Please download and you must register software !!!

PLEASE REGISTER SOFTWARE:
http://www.webteam.gsi.pl/rejestracja.htm
DOWNLOAD LEGAL SOFTWARE:
http://www.webteam.gsi.pl

Full question and post: http://www.webteam.gsi.pl

Contact and service and advanced technology:
http://www.webteam.gsi.pl/kontakt.htm
FAQ: http://www.webteam.gsi.pl/naj_czesciej_zadawane_pytania.htm

Please add me URL for you all site and search engines and best friends !!!

Me site:
SERWIS WEBNETI: http://www.webneti.gsi.pl
PORTAL WEBTEAM: http://www.webteam.gsi.pl
LANGUAGE: http://www.webneti.cjb.net
============================================================================
================
 
Back
Top