473,661 Members | 2,457 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Deleting filtered records not working properly.

I'm using Access 2000 working in DAO at the moment and am having
trouble deleting a record from a form that has been filtered.

So I'm filtering a form and then when the user selects the record and
tries to delete it using that button on the toolbar (i haven't been
using any manually coded method) that default delete confirmation
message is not coming up even though the record is successfully being
deleted from the database.

Also any code that i put in Form_Delete, Form_AfterDelCo nfirm and
Form_BeforeDelC onfirm is not being triggered.

Anyone know how to fix this? I don't have this problem when i don't
apply a filtered to forms.

thanks

Donald

Nov 13 '05 #1
3 3369
A slight correction the form_delete event is being triggered, however
the Form_AfterDelCo nfirm and Form_BeforeDelC onfirm events are not
being triggered even after i tried to use the code in the
documentation. ie.

Sub Form_BeforeDelC onfirm(Cancel As Integer, Response As Integer)
' Suppress default Delete Confirm dialog box.
Response = acDataErrContin ue
' Display custom dialog box.
If MsgBox("Delete this record?", vbOKCancel) = vbCancel Then
Cancel = True
End If
End Sub

Sub Form_AfterDelCo nfirm(Status As Integer)
Select Case Status
Case acDeleteOK
MsgBox "Deletion occurred normally."
cboTagSearch.Re query
Case acDeleteCancel
MsgBox "Programmer canceled the deletion."
Case acDeleteUserCan cel
MsgBox "User canceled the deletion."
End Select
End Sub

Nov 13 '05 #2
On 4 Jun 2005 16:11:08 -0700, "deekay" <de*****@gmail. com> wrote:

Have you tried:
SetOption "Confirm Document Deletions", True
Read the help file on BeforeDelConfir m: this event does not fire when
this setting is False.

-Tom.

I'm using Access 2000 working in DAO at the moment and am having
trouble deleting a record from a form that has been filtered.

So I'm filtering a form and then when the user selects the record and
tries to delete it using that button on the toolbar (i haven't been
using any manually coded method) that default delete confirmation
message is not coming up even though the record is successfully being
deleted from the database.

Also any code that i put in Form_Delete, Form_AfterDelCo nfirm and
Form_BeforeDel Confirm is not being triggered.

Anyone know how to fix this? I don't have this problem when i don't
apply a filtered to forms.

thanks

Donald


Nov 13 '05 #3
"deekay" <de*****@gmail. com> wrote in
news:11******** **************@ g49g2000cwa.goo glegroups.com:
A slight correction the form_delete event is being triggered,
however the Form_AfterDelCo nfirm and Form_BeforeDelC onfirm events
are not being triggered even after i tried to use the code in the
documentation.


I never depend on these event firing, because, as Tom says,
user-configurable options can cause them to never fire.

For deletions, I set the form so that AllowDeletions is off, and
have a dedicated DELETE RECORD button. That way I can control the
process myself.

I actually started doing that before I knew about the fact that the
global option caused the events not to fire, because I hated needing
to cache information about the record being deleted so that I could
supply a meaningful deletion message. What I mean by that is that,
by the time the Delete event happens, the record is gone, so you can
no longer collect data from the record to identify it in the
messagbox you pop up asking for confirmation. This is important,
because the displayed record at that point is *not* the one you're
deleting, but the one after it.

Because of that, I consider it crucial to have the confirm message
identify the record, and that could only be done by storing the
needed values in variables in the OnCurrent event (which also meant
you needed to have variables for the current record and for the
previous record, since by the time the delete event fires, a new
record is current).

With a custom command button, you can control the order of events,
presenting the confirmation message before the record is actually
deleted, so that you don't have to cache information about the
record.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1994
by: Mike Turco | last post by:
I'm working on an application that imports and exports tons of CSV data, like 64,000 records per file, and six or seven files in a set. First off, by the tine I import a few hundred thousand records the database is _huge_. Like 500 meg, although the csv files are only 25 meg in total. When I compact the database its still 100meg. How do I keep the size down? Second, I did a manual delete of 300,000 records yesterday by doing a...
1
5415
by: Ken | last post by:
I have a form that has a command button on it to open a report. The report is based on the forms data, if it's filtered the report is filtered, if the form is showing 100 records the report is showing the same 100 records, etc. I want to create another command button which exports to excel, in the same manner above. Whether the form is filtered or not, the same records should be exported. I played around with TransferSpreadsheet but I...
2
10011
by: HansP | last post by:
Hi, I am really in a deadlock with this problem. In my VS2005 C# handheld application, I have a grid with Workorders. Another grid (child) are the ACTIONS, performed for each workorder. Both grids have Dataviews as DataSource. The child grid, filtered with RowFilter in the DataView works fine.
3
3451
by: melnhed | last post by:
---Report the current filtered records from a Form--- Hello All, I've seen this topic discussed before, but the solution described then doesn't work in my particular case. My Config: Access 2002 front-end using SQL Server 2000 (MSDE actually) via ADP/ADE Access Data Project.
1
2486
by: Shortstuff12345 | last post by:
This can be ignored... I did a bunch more searching and tried a few more things listed on different posts. I was able to get the delete query to work properly by adding a statement in the code (Me.Requery) to refresh the information on the form and the #deleted went away. -------------------------------------------------------------------------------------------------------------- First of all, I want to say thanks for help on my...
0
1675
by: Ironr4ge | last post by:
Hi everyone, By the rate its going it want be long till I start growing gray hair... but anyway.. to come to the point... I am trying to open the form "Languages" with a diffrent record source to the "Contacts" form where I conducted the search or filter... . I was wondering whether there was a simple vba code to select ONLY ALL FILTERED records of my first form or the "Contacts"
4
2928
by: Ironr4ge | last post by:
Hi everyone, I am trying to open the form "Languages" with a diffrent record source to the "Contacts" form where I conducted the search or filter... . I was wondering whether there was a vba code to select ONLY ALL FILTERED records of my first form or the "Contacts" and open this filtered set of records in my "Languages" form. I have a key field on both tables named id_individual.
14
2334
kcdoell
by: kcdoell | last post by:
Hello: I have a form (Default view =single form) with a subform (Default view =continuous forms) embedded into it. In the form I have three controls that display the Division, Working Region & Credit Region. The subform displays the data/records. The record source for both my form and subform is driven by a query, which is the way I filter the records that the end user will see via another form I created. Everything is working fine but...
6
2352
jinalpatel
by: jinalpatel | last post by:
I am using following code for searching records. 'Purpose: Build up the criteria string form the non-blank search boxes, and apply to the form's Filter. 'Notes: 1. We tack " AND " on the end of each condition so you can easily add more search boxes; _ we remove the trailing " AND " at the end. Dim strWhere As String 'The criteria string. Dim lngLen As...
0
8428
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
8542
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8630
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7362
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6181
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4343
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1984
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1740
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.