Solved

Bug?: acCmdDeleteRecord deletes all io one?

Posted on 2001-07-26
7
274 Views
Last Modified: 2012-05-04
Greetings,

Long time since I last asked a question in this topic area. Now I have something I already have a solution for. Thus, the real question is: is this a bug or am I crazy?

I created a form, displaying multiple records. A filter is active to display only the records related to a certain key value. AllowEdits = True, AllowDeletions = False. The form has a command button, allowing the user to delete the current (chosen) record. The code looks like this:

If Me.RecordsetClone.RecordCount > 1 Then
            Me.AllowDeletions = True
            DoCmd.RunCommand acCmdDeleteRecord
            Me.AllowDeletions = False
End If

Instead of only deleting the current record, M$ Access 2000 for M$ Win95 deletes all displayed records! (The records also in the source of the form, but filtered out, are still there.)

The record provides enough information to delete it by Sql execution, so deleting isn't the problem. What I would like to know is, is my copy of Access the only one acting this way and do I need to reinstall or did you see this too? Is this a bug in Access 2000 or did I goof?

Imagine!
0
Comment
Question by:OmegaJunior
  • 3
  • 2
  • 2
7 Comments
 
LVL 54

Expert Comment

by:nico5038
ID: 6321493
Strange, tested it on my A2000 database and it worked on a record level.
Do you have perhaps the code in a continuous form?

Nic;o)
0
 
LVL 3

Author Comment

by:OmegaJunior
ID: 6321776
Yes, I'm showing multiple records in a continuous form.
0
 
LVL 54

Expert Comment

by:nico5038
ID: 6321880
Still strange, as even a button on a continuous form works per record for me.
Do you have additional code behind the form with also a delete?

Nic;o)
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 50 total points
ID: 6322857
Might want to do a acSelectRecord to ensure that only one record is selected before attempting to delete.

Jim.
0
 
LVL 3

Author Comment

by:OmegaJunior
ID: 6406546
The user (in testing cases, me) has selected a record, otherwise the delete method wouldn't work at all. I doubt it's necessary then to explicitely select the already chosen record.

0
 
LVL 57
ID: 6406616
Try the command anyway. You might be surprised.

Jim.
0
 
LVL 3

Author Comment

by:OmegaJunior
ID: 6479473
These are the things M$ doesn't bother to inform us about.

Imagine!
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

823 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question