Solved

Bug?: acCmdDeleteRecord deletes all io one?

Posted on 2001-07-26
7
272 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
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…

920 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

13 Experts available now in Live!

Get 1:1 Help Now