Solved

Bug?: acCmdDeleteRecord deletes all io one?

Posted on 2001-07-26
7
271 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

743 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now