473,414 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Order of events - delete record in subform

Hi,

I have a subform in a form in an ADP that I am creating "form-by-form" based
on an equivalent MDB front-end db.
(I'm converting from a front-end/back-end mdb structure to an AccessXP ADP +
SQL2000DE. It's amazing the number of gotchas I'm coming across in the
process.)

Like this: When I delete a record from the datasheet subform, I'm finding
that the FormDelete event runs last !
I proved that to myself (when trying to track down a bug) by putting the
following event handlers in the form that becomes the subform:

Private Sub Form_AfterDelConfirm(Status As Integer)
Debug.Print "AfterDelConfirm"
End Sub

Private Sub Form_BeforeDelConfirm(Cancel As Integer, Response As Integer)
Debug.Print "BeforeDelConfirm"
End Sub

Private Sub Form_Delete(Cancel As Integer)
Debug.Print "FormDelete"
End Sub

The Immediate Window lists the following:
BeforeDelConfirm
AfterDelConfirm
FormDelete

This is quite different to what Access Help says (although that is still
correct for MDB forms).
Also, if deletion is cancelled by the user, then FormDelete does not run at
all, although BeforeDelConfirm & AfterDelConfirm still do.

Hopefully someone is keeping a list of "Upsizing Gotchas" so maybe I don't
have to find out all these things the hard way, since the Access Help is
little help at all these days.

Ian.
Nov 13 '05 #1
2 8280
Yep:
Order of Form Delete Events Differs in ADPs and MDBs
at:
http://support.microsoft.com/default...b;en-us;234866

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Ian Hinson" <pp******@bigpond.net.au> wrote in message
news:K1******************@news-server.bigpond.net.au...
Hi,

I have a subform in a form in an ADP that I am creating "form-by-form"
based
on an equivalent MDB front-end db.
(I'm converting from a front-end/back-end mdb structure to an AccessXP ADP
+
SQL2000DE. It's amazing the number of gotchas I'm coming across in the
process.)

Like this: When I delete a record from the datasheet subform, I'm finding
that the FormDelete event runs last !
I proved that to myself (when trying to track down a bug) by putting the
following event handlers in the form that becomes the subform:

Private Sub Form_AfterDelConfirm(Status As Integer)
Debug.Print "AfterDelConfirm"
End Sub

Private Sub Form_BeforeDelConfirm(Cancel As Integer, Response As Integer)
Debug.Print "BeforeDelConfirm"
End Sub

Private Sub Form_Delete(Cancel As Integer)
Debug.Print "FormDelete"
End Sub

The Immediate Window lists the following:
BeforeDelConfirm
AfterDelConfirm
FormDelete

This is quite different to what Access Help says (although that is still
correct for MDB forms).
Also, if deletion is cancelled by the user, then FormDelete does not run
at all, although BeforeDelConfirm & AfterDelConfirm still do.

Hopefully someone is keeping a list of "Upsizing Gotchas" so maybe I don't
have to find out all these things the hard way, since the Access Help is
little help at all these days.

Ian.

Nov 13 '05 #2
Ian Hinson wrote:
Hi,

I have a subform in a form in an ADP that I am creating "form-by-form" based
on an equivalent MDB front-end db.
(I'm converting from a front-end/back-end mdb structure to an AccessXP ADP +
SQL2000DE. It's amazing the number of gotchas I'm coming across in the
process.)
It's not amazing to me although I am still dazed and confused by the
experience.
Like this: When I delete a record from the datasheet subform, I'm finding
that the FormDelete event runs last !
This is quite different to what Access Help says (although that is still
correct for MDB forms).
Well, Access Help has never been accurate about anything. It can give a
bit of direction, but I think one should never accept what it says
without testing.
Also, if deletion is cancelled by the user, then FormDelete does not run at
all, although BeforeDelConfirm & AfterDelConfirm still do.
Of course, you may have found this on a Monday. It is not necessarily
true that you will find the same results on Tuesday. I have found ADPs
to be erratic to the extreme.
Hopefully someone is keeping a list of "Upsizing Gotchas" so maybe I don't
have to find out all these things the hard way, since the Access Help is
little help at all these days.


I started but ran out of disk space, (160 gigs), and so gave up.
--
Lyle Fairfield
Nov 13 '05 #3

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

Similar topics

2
by: Deano | last post by:
Hi, I was just setting up a test system on a client's machine yesterday and as ever noticed a few problems. One that has thrown me is to do with the order of records in a subform (datasheet...
8
by: Steve | last post by:
I have several pairs of synchronized subforms in an application. I have a Delete button for each pair that uses the following code or similar to delete a record in the second subform: ...
0
by: John Hunter | last post by:
I've recently had a nasty problem with the "Invalid reference to the property Form" error in subforms - nasty because it doesn't seem to consistently happen to all forms which contain the same...
1
by: xmp333 | last post by:
Hi, I have a form that is designed as a data sheet view. Attached to this is a subform with some VB code. When the user clicks on a row, the subform should pop up and run the VB code which...
3
by: Maria | last post by:
Is there another way to delete the current record in a subform from the main form, another subform or a sub-subform other than setting focus on a field in the subform and using run command...
2
by: Mike | last post by:
Greetings, It would seem that this topic has been discussed at some length, but I was unable to discern whether there was a clear cut solution to resolve and/or otherwise workaround the issue. ...
4
by: Steven | last post by:
Hi, Would need some thought about using a button of the existing form to search record before deleting it. Any quick help is very appreciated. Steve
3
by: brucedodds | last post by:
My application has a form based on a parent table with a subform based on a child table. The relationship is Cascade Delete. The first record displayed when the form opens has five child records....
4
by: Harlequin | last post by:
I have a question concerning the need to trigger events within a "child" subform which is itself enbedded within a master "parent" form and which is accessible via a tab in the parent form. Becuase...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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...
0
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,...

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.