To display or not to display

Trinb37

Registered User.
Local time
Today, 18:52
Joined
Oct 9, 2003
Messages
23
Hi,
here is the thing. I have this Access program that I am working on that is suppose to delete the selected item in the list box when every I click the delete button. When the delete button is clicked the item in the list box on top would be deleted and not the one that is already selected. Is there anyone who can show me what I did or rewrite the code for me? This is the code that I was working with:

Private Sub cmdDelete_Click()
On Error GoTo Err_cmdDelete_Click
DoCmd.RunCommand acCmdDeleteRecord
Me.List0.Requery
Exit_cmdDelete_Click:
Exit Sub
Err_cmdDelete_Click:
MsgBox Err.Description
Resume Exit_cmdDelete_Click

End Sub

I also took the liberty of uploading the whole utility program so that you can take a closer look at it.:eek:

~~~~~~~~~~~~~~~~~
James
 

Attachments

add this to your UP button code
DoCmd.GoToRecord , , acPrevious

and
DoCmd.GoToRecord , , acNext
to your DOWN button code.

The reason it always deleted the first record is that the ACTUAL record never moved and always stayed on the first record.
 
Thank you very much. You would not believe all the kinds of stories I heard from other people on how to fix this problem. But you came through for me and very greatful.
 
Thank you very much. You would not believe all the kinds of stories I heard from other people on how to fix this problem. But you came through for me and very greatful.
 
Thank you very much. You would not believe all the kinds of stories I heard from other people on how to fix this problem. But you came through for me and very greatful.
 

Users who are viewing this thread

Back
Top Bottom