Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Bug?: acCmdDeleteRecord deletes all io one?

Posted on 2001-07-26
7
Medium Priority
?
280 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 58

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 200 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 58
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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

596 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