PC Review


Reply
Thread Tools Rate Thread

beforeDelConfirm and afterDelConfirm events not firing

 
 
Mark
Guest
Posts: n/a
 
      15th Oct 2006
Hi

I'm using an Access XP (mdb) which links to SQL Server to retrieve and write
data. Data is pulled into front-end tables for editng etc. and then written
back to the server (reducing connections etc. and resulting in blinding
speed).

I have a form (form view) which contains a subform (datasheet) with another
subform as a sub-datasheet all bound to front-end tables. My options are set
to issue warnings etc., but for some reason the beforeDelConfirm and
afterDelConfirm events don't fire on either subform.

I have created a simple form/sub/sub and the events fire fine, but in the
real form they don't fire at all. the onDelete event fires ok though.

Anyone know where the problem might be...

Cheers

Mark



 
Reply With Quote
 
 
 
 
=?Utf-8?B?S2VuIFNoZXJpZGFu?=
Guest
Posts: n/a
 
      15th Oct 2006
Mark:

Are you unconditionally setting the return value of the Delete event
procedure's cancel argument to True? If so the BeforeDelConfirm and
AfterDelConfirm events won't execute. To use a custom deletion confirmation
message you'd put something like this in the Delete event procedure:

If MsgBox("Delete record?", vbQuestion + vbYesNo, "Confirm Deletion") =
vbNo Then
Cancel = True
End If

And suppress the system message if the user elects to delete by setting the
return value of the BeforeDelConfirm procedure's Response argument:

Response = acDataErrContinue

Ken Sheridan
Stafford, England

"Mark" wrote:

> Hi
>
> I'm using an Access XP (mdb) which links to SQL Server to retrieve and write
> data. Data is pulled into front-end tables for editng etc. and then written
> back to the server (reducing connections etc. and resulting in blinding
> speed).
>
> I have a form (form view) which contains a subform (datasheet) with another
> subform as a sub-datasheet all bound to front-end tables. My options are set
> to issue warnings etc., but for some reason the beforeDelConfirm and
> afterDelConfirm events don't fire on either subform.
>
> I have created a simple form/sub/sub and the events fire fine, but in the
> real form they don't fire at all. the onDelete event fires ok though.
>
> Anyone know where the problem might be...
>
> Cheers
>
> Mark
>
>
>
>


 
Reply With Quote
 
Mark
Guest
Posts: n/a
 
      16th Oct 2006
Hi Ken

Thanks for replying. No, I only looked at using the onDelete event after I
couldn't get beforeDelConfirm/afterDelConfirm working.

I will strip the code tomorrow and see if I can isolate the problem.

Thanks again

Mark


"Ken Sheridan" <(E-Mail Removed)> wrote in message
news:5A10996D-1144-486F-B8C9-(E-Mail Removed)...
> Mark:
>
> Are you unconditionally setting the return value of the Delete event
> procedure's cancel argument to True? If so the BeforeDelConfirm and
> AfterDelConfirm events won't execute. To use a custom deletion
> confirmation
> message you'd put something like this in the Delete event procedure:
>
> If MsgBox("Delete record?", vbQuestion + vbYesNo, "Confirm Deletion")
> =
> vbNo Then
> Cancel = True
> End If
>
> And suppress the system message if the user elects to delete by setting
> the
> return value of the BeforeDelConfirm procedure's Response argument:
>
> Response = acDataErrContinue
>
> Ken Sheridan
> Stafford, England
>
> "Mark" wrote:
>
>> Hi
>>
>> I'm using an Access XP (mdb) which links to SQL Server to retrieve and
>> write
>> data. Data is pulled into front-end tables for editng etc. and then
>> written
>> back to the server (reducing connections etc. and resulting in blinding
>> speed).
>>
>> I have a form (form view) which contains a subform (datasheet) with
>> another
>> subform as a sub-datasheet all bound to front-end tables. My options are
>> set
>> to issue warnings etc., but for some reason the beforeDelConfirm and
>> afterDelConfirm events don't fire on either subform.
>>
>> I have created a simple form/sub/sub and the events fire fine, but in the
>> real form they don't fire at all. the onDelete event fires ok though.
>>
>> Anyone know where the problem might be...
>>
>> Cheers
>>
>> Mark
>>
>>
>>
>>

>



 
Reply With Quote
 
Mark
Guest
Posts: n/a
 
      16th Oct 2006
Hello again...

I got rid of the onDelete code (just in case) and put a simple "Stop" on the
beforeDelConfirm and afterDelConfirm. Neither event fires...?

Cheers

Mark


"Mark" <(E-Mail Removed)> wrote in message
news:hPAYg.30897$(E-Mail Removed)...
> Hi Ken
>
> Thanks for replying. No, I only looked at using the onDelete event after I
> couldn't get beforeDelConfirm/afterDelConfirm working.
>
> I will strip the code tomorrow and see if I can isolate the problem.
>
> Thanks again
>
> Mark
>
>
> "Ken Sheridan" <(E-Mail Removed)> wrote in message
> news:5A10996D-1144-486F-B8C9-(E-Mail Removed)...
>> Mark:
>>
>> Are you unconditionally setting the return value of the Delete event
>> procedure's cancel argument to True? If so the BeforeDelConfirm and
>> AfterDelConfirm events won't execute. To use a custom deletion
>> confirmation
>> message you'd put something like this in the Delete event procedure:
>>
>> If MsgBox("Delete record?", vbQuestion + vbYesNo, "Confirm Deletion")
>> =
>> vbNo Then
>> Cancel = True
>> End If
>>
>> And suppress the system message if the user elects to delete by setting
>> the
>> return value of the BeforeDelConfirm procedure's Response argument:
>>
>> Response = acDataErrContinue
>>
>> Ken Sheridan
>> Stafford, England
>>
>> "Mark" wrote:
>>
>>> Hi
>>>
>>> I'm using an Access XP (mdb) which links to SQL Server to retrieve and
>>> write
>>> data. Data is pulled into front-end tables for editng etc. and then
>>> written
>>> back to the server (reducing connections etc. and resulting in blinding
>>> speed).
>>>
>>> I have a form (form view) which contains a subform (datasheet) with
>>> another
>>> subform as a sub-datasheet all bound to front-end tables. My options are
>>> set
>>> to issue warnings etc., but for some reason the beforeDelConfirm and
>>> afterDelConfirm events don't fire on either subform.
>>>
>>> I have created a simple form/sub/sub and the events fire fine, but in
>>> the
>>> real form they don't fire at all. the onDelete event fires ok though.
>>>
>>> Anyone know where the problem might be...
>>>
>>> Cheers
>>>
>>> Mark
>>>
>>>
>>>
>>>

>>

>
>



 
Reply With Quote
 
=?Utf-8?B?S2VuIFNoZXJpZGFu?=
Guest
Posts: n/a
 
      16th Oct 2006
Mark:

In that case I think you might find that the 'Record Changes' Confirm option
on the Edit/Find tab of the Options dialogue (Tools | Options on the main
database menu bar) is unchecked. If so check it and the events should fire.

Ken Sheridan
Stafford, England

"Mark" wrote:

> Hello again...
>
> I got rid of the onDelete code (just in case) and put a simple "Stop" on the
> beforeDelConfirm and afterDelConfirm. Neither event fires...?
>
> Cheers
>
> Mark
>
>


 
Reply With Quote
 
Mark
Guest
Posts: n/a
 
      16th Oct 2006
Hi Ken...

That was the first thing I checked ('scuse the pun :@)

Cheers

Mark

"Ken Sheridan" <(E-Mail Removed)> wrote in message
news:9082E226-6B7C-43B7-A456-(E-Mail Removed)...
> Mark:
>
> In that case I think you might find that the 'Record Changes' Confirm
> option
> on the Edit/Find tab of the Options dialogue (Tools | Options on the main
> database menu bar) is unchecked. If so check it and the events should
> fire.
>
> Ken Sheridan
> Stafford, England
>
> "Mark" wrote:
>
>> Hello again...
>>
>> I got rid of the onDelete code (just in case) and put a simple "Stop" on
>> the
>> beforeDelConfirm and afterDelConfirm. Neither event fires...?
>>
>> Cheers
>>
>> Mark
>>
>>

>



 
Reply With Quote
 
dbahooker@hotmail.com
Guest
Posts: n/a
 
      17th Oct 2006
MDB isn't reliable... I think that you should move to Access Data
Projects and not worry about various bugs in the MDB family

-Aaron


Mark wrote:
> Hi Ken...
>
> That was the first thing I checked ('scuse the pun :@)
>
> Cheers
>
> Mark
>
> "Ken Sheridan" <(E-Mail Removed)> wrote in message
> news:9082E226-6B7C-43B7-A456-(E-Mail Removed)...
> > Mark:
> >
> > In that case I think you might find that the 'Record Changes' Confirm
> > option
> > on the Edit/Find tab of the Options dialogue (Tools | Options on the main
> > database menu bar) is unchecked. If so check it and the events should
> > fire.
> >
> > Ken Sheridan
> > Stafford, England
> >
> > "Mark" wrote:
> >
> >> Hello again...
> >>
> >> I got rid of the onDelete code (just in case) and put a simple "Stop" on
> >> the
> >> beforeDelConfirm and afterDelConfirm. Neither event fires...?
> >>
> >> Cheers
> >>
> >> Mark
> >>
> >>

> >


 
Reply With Quote
 
=?Utf-8?B?S2VuIFNoZXJpZGFu?=
Guest
Posts: n/a
 
      17th Oct 2006
Mark:

You mentioned in your original post that these were subforms. It is the
subforms' event procedures you are using I assume, not the parent form's,
when handling deletions of rows in the subforms' underlying recordsets?

Ken Sheridan
Stafford, England

"Mark" wrote:

> Hi Ken...
>
> That was the first thing I checked ('scuse the pun :@)
>
> Cheers
>
> Mark
>


 
Reply With Quote
 
Mark
Guest
Posts: n/a
 
      17th Oct 2006
Hi Ken

Thats right, I'm trying to catch the event in the subform that contains the
record.

Cheers

Mark

"Ken Sheridan" <(E-Mail Removed)> wrote in message
news:63CBA37F-0DE9-45ED-A467-(E-Mail Removed)...
> Mark:
>
> You mentioned in your original post that these were subforms. It is the
> subforms' event procedures you are using I assume, not the parent form's,
> when handling deletions of rows in the subforms' underlying recordsets?
>
> Ken Sheridan
> Stafford, England
>
> "Mark" wrote:
>
>> Hi Ken...
>>
>> That was the first thing I checked ('scuse the pun :@)
>>
>> Cheers
>>
>> Mark
>>

>



 
Reply With Quote
 
Mark
Guest
Posts: n/a
 
      17th Oct 2006
Hi Aaron

I heard from another group (and this was a year or so ago so may be rubbish
by now) that ADP would be phased out sometime soon. Is this still the case?

I have developed many projects using ADP and found that (though developement
time is slightly longer) using a front-end MDE which handles the data using
ADO commands and pass-through queries is a lot faster (we are on a slow
network by the way). ADP is a nice idea in an ideal environment but I found
a bound form takes a lot longer to load in an ADP than an MDE opened
exclusively which copies the data to front-end tables. My clients find (with
SQL Server backend) an MDE using ADO etc. is generally more responsive.

Also, giving permissions on tables/views in order to bind is out of the
question. We use only stored procedures for reading and writing data (no
views at all and no users have permissions on tables). I'm not sure if you
could bind a form (in ADP) to a parameterised stored procedure (I never
really tried), but assuming you can't then having to grant permissions on
tables/views would make an ADP unsuitable for many situations.

General I would use vb.NET and ADO but the platform is dictated by the
client in this situation.

Cheers

Mark

<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> MDB isn't reliable... I think that you should move to Access Data
> Projects and not worry about various bugs in the MDB family
>
> -Aaron
>
>
> Mark wrote:
>> Hi Ken...
>>
>> That was the first thing I checked ('scuse the pun :@)
>>
>> Cheers
>>
>> Mark
>>
>> "Ken Sheridan" <(E-Mail Removed)> wrote in message
>> news:9082E226-6B7C-43B7-A456-(E-Mail Removed)...
>> > Mark:
>> >
>> > In that case I think you might find that the 'Record Changes' Confirm
>> > option
>> > on the Edit/Find tab of the Options dialogue (Tools | Options on the
>> > main
>> > database menu bar) is unchecked. If so check it and the events should
>> > fire.
>> >
>> > Ken Sheridan
>> > Stafford, England
>> >
>> > "Mark" wrote:
>> >
>> >> Hello again...
>> >>
>> >> I got rid of the onDelete code (just in case) and put a simple "Stop"
>> >> on
>> >> the
>> >> beforeDelConfirm and afterDelConfirm. Neither event fires...?
>> >>
>> >> Cheers
>> >>
>> >> Mark
>> >>
>> >>
>> >

>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
dynamically adding controls with events (but events are not firing) SevDer Microsoft ASP .NET 2 13th Nov 2007 06:33 AM
BeforeDelConfirm and AfterDelConfirm not running =?Utf-8?B?TWFydHk=?= Microsoft Access VBA Modules 2 24th Oct 2006 10:00 PM
BeforeDelConfirm/Delele events (in a from on a Tab Control) =?Utf-8?B?U29kZHk=?= Microsoft Access Form Coding 3 13th Oct 2006 05:01 PM
Before/AfterDelConfirm events not firing KC Microsoft Access Forms 3 21st Sep 2006 03:42 PM
afterdelconfirm/beforedelconfirm event not working in a2k mdb =?Utf-8?B?VGVk?= Microsoft Access Form Coding 13 25th Feb 2005 02:07 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:01 AM.