Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 281
  • Last Modified:

Bug?: acCmdDeleteRecord deletes all io one?

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
OmegaJunior
Asked:
OmegaJunior
  • 3
  • 2
  • 2
1 Solution
 
nico5038Commented:
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
 
OmegaJuniorAuthor Commented:
Yes, I'm showing multiple records in a continuous form.
0
 
nico5038Commented:
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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
Might want to do a acSelectRecord to ensure that only one record is selected before attempting to delete.

Jim.
0
 
OmegaJuniorAuthor Commented:
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
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
Try the command anyway. You might be surprised.

Jim.
0
 
OmegaJuniorAuthor Commented:
These are the things M$ doesn't bother to inform us about.

Imagine!
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now