Go Back   Access World Forums > Microsoft Access Discussion > Forms

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 03-01-2008, 08:53 AM   #1
David Eagar
Newly Registered User
 
Join Date: Jul 2007
Location: Far South Coast, NSW, Australia
Posts: 924
Thanks: 0
Thanked 0 Times in 0 Posts
David Eagar is on a distinguished road
Close Form fatal error

In the attached db, when exiting the form 9frmFacPerformance, it asks for a query criteria and crashes the db, but only when it finds data.

Have struggled four hours rejigging the underlying queries, but have made no progress. Any clues most gratefully accepted
Attached Files
File Type: zip WorkshopModules.zip (79.0 KB, 67 views)

David Eagar is offline   Reply With Quote
Old 03-01-2008, 09:52 AM   #2
Uncle Gizmo
Nifty Access Guy
 
Uncle Gizmo's Avatar
 
Join Date: Jul 2003
Location: Newbury Berks UK
Posts: 10,007
Thanks: 461
Thanked 889 Times in 844 Posts
Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough
Send a message via Skype™ to Uncle Gizmo
The form appeared to work, and close normally but once when it closed it did indeed crash MS access and offered some advice from the Microsoft website see attached picture:

__________________
Code:
                 |||||
               @(~^~)@
-------------oOo---U---oOo-------------
|                                     |
|      Uncle Gizmo              |
|                                     |
|                                     |
| Get $20 worth of "Nifty Code"       |
|      
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| | Ooo | |_________________ooO____( )________| ( ) ) / \ ( (_/ \_)
Uncle Gizmo is offline   Reply With Quote
Old 03-01-2008, 10:29 AM   #3
David Eagar
Newly Registered User
 
Join Date: Jul 2007
Location: Far South Coast, NSW, Australia
Posts: 924
Thanks: 0
Thanked 0 Times in 0 Posts
David Eagar is on a distinguished road
Thanks for the tip - Have done a windows update and no updates are required, so I assume I am up to date

David Eagar is offline   Reply With Quote
Old 03-01-2008, 10:52 AM   #4
David Eagar
Newly Registered User
 
Join Date: Jul 2007
Location: Far South Coast, NSW, Australia
Posts: 924
Thanks: 0
Thanked 0 Times in 0 Posts
David Eagar is on a distinguished road
Udate - created new db and imported all objects - it still crashed
David Eagar is offline   Reply With Quote
Old 03-01-2008, 04:54 PM   #5
Uncle Gizmo
Nifty Access Guy
 
Uncle Gizmo's Avatar
 
Join Date: Jul 2003
Location: Newbury Berks UK
Posts: 10,007
Thanks: 461
Thanked 889 Times in 844 Posts
Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough
Send a message via Skype™ to Uncle Gizmo
Right, as far as I can tell your subform "9frmFacPerformanceSub" is based on a query "9qryFacPerformance" Which points back to a field in your main form named "TR".

What I suspect is happening is when you close the main form, The subform is not closed until after, so the subform tries to reference the main form but the main form is now closed and causes your error.

For example if you add the following code to the command button that closes the form:

'Me.TR = "Daryl Irwin"
Me.TR = ""
Me.Refresh
DoCmd.Close

You now get an error message, and an error number I think it was 3054 or something, indicating that the object cannot be accessed anymore for some reason.

(Backs up my theory)

You could try trapping this error, Don't know though.
__________________
Code:
                 |||||
               @(~^~)@
-------------oOo---U---oOo-------------
|                                     |
|      Uncle Gizmo              |
|                                     |
|                                     |
| Get $20 worth of "Nifty Code"       |
|      
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| | Ooo | |_________________ooO____( )________| ( ) ) / \ ( (_/ \_)
Uncle Gizmo is offline   Reply With Quote
Old 03-01-2008, 05:16 PM   #6
David Eagar
Newly Registered User
 
Join Date: Jul 2007
Location: Far South Coast, NSW, Australia
Posts: 924
Thanks: 0
Thanked 0 Times in 0 Posts
David Eagar is on a distinguished road
Thanks for your efforts - Will investigate and report back. It sounds like your on the right track as the error on close does suggest a 'loop' somewhere

Thanks again
David Eagar is offline   Reply With Quote
Old 03-01-2008, 05:20 PM   #7
Uncle Gizmo
Nifty Access Guy
 
Uncle Gizmo's Avatar
 
Join Date: Jul 2003
Location: Newbury Berks UK
Posts: 10,007
Thanks: 461
Thanked 889 Times in 844 Posts
Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough
Send a message via Skype™ to Uncle Gizmo
I just removed the subform "within" the subform and it appears to work correctly.

So I believe it's this extra subform you've got, it calls on the same query, and I reckon that's where the error is.

__________________
Code:
                 |||||
               @(~^~)@
-------------oOo---U---oOo-------------
|                                     |
|      Uncle Gizmo              |
|                                     |
|                                     |
| Get $20 worth of "Nifty Code"       |
|      
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| | Ooo | |_________________ooO____( )________| ( ) ) / \ ( (_/ \_)
Uncle Gizmo is offline   Reply With Quote
Old 03-01-2008, 05:28 PM   #8
Uncle Gizmo
Nifty Access Guy
 
Uncle Gizmo's Avatar
 
Join Date: Jul 2003
Location: Newbury Berks UK
Posts: 10,007
Thanks: 461
Thanked 889 Times in 844 Posts
Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough
Send a message via Skype™ to Uncle Gizmo
I have setup many forms like this, one Unbound combo box controlling the display in a subform and have never had this problem before, this is why I was puzzled.

However I noted your extra subform within the main subform, and removed it and it worked OK.

So I would guess what is happening, when a first "Level" subform closes everything is fine, however because you have a second form within the subform, the "second Level" of subform(s) if you like, then this is confusing the order in which MS Access closes down the form, creating the error.

I would suggest instead of the imbedding your extra subform within the other subform have it separate and just above your existing subform so that you will now have two subforms directly on top of your main form. (if that makes sense)
__________________
Code:
                 |||||
               @(~^~)@
-------------oOo---U---oOo-------------
|                                     |
|      Uncle Gizmo              |
|                                     |
|                                     |
| Get $20 worth of "Nifty Code"       |
|      
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| | Ooo | |_________________ooO____( )________| ( ) ) / \ ( (_/ \_)
Uncle Gizmo is offline   Reply With Quote
Old 03-01-2008, 05:38 PM   #9
Uncle Gizmo
Nifty Access Guy
 
Uncle Gizmo's Avatar
 
Join Date: Jul 2003
Location: Newbury Berks UK
Posts: 10,007
Thanks: 461
Thanked 889 Times in 844 Posts
Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough Uncle Gizmo is a jewel in the rough
Send a message via Skype™ to Uncle Gizmo
The other thing I am uncomfortable with is your use of the "%" in one of your control names, and I think it's also in a field name?

I'm not saying this is causing the problem at all, however it is considered bad practice, and to be avoided. If it's not causing you a bug now, it could well do in the future. You could spend hours trying to track down the bug, just because MS Access gets upset because of a nonstandard character in a field name or control name.

The other thing is I suggest using the naming convention for your combo box and other controls, this helps MS Access distinguish between the field the control is based on and the control itself. Again another area which could lead to buggy code difficult to track down, hours if not days of head scratching.
__________________
Code:
                 |||||
               @(~^~)@
-------------oOo---U---oOo-------------
|                                     |
|      Uncle Gizmo              |
|                                     |
|                                     |
| Get $20 worth of "Nifty Code"       |
|      
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
| | Ooo | |_________________ooO____( )________| ( ) ) / \ ( (_/ \_)
Uncle Gizmo is offline   Reply With Quote
Old 03-01-2008, 06:42 PM   #10
David Eagar
Newly Registered User
 
Join Date: Jul 2007
Location: Far South Coast, NSW, Australia
Posts: 924
Thanks: 0
Thanked 0 Times in 0 Posts
David Eagar is on a distinguished road
Thank you kindly sir - I too have many forms set up this way with no problems, even sub sub forms (although not sure if I have them sourced from the same query). The use of % in a field name is not something I can recall doing before and as you say, may be the problem - even so, if it is bad practice, i shall desist immediately!!

Once again, thanks for all your efforts
David Eagar is offline   Reply With Quote
Old 03-01-2008, 10:30 PM   #11
David Eagar
Newly Registered User
 
Join Date: Jul 2007
Location: Far South Coast, NSW, Australia
Posts: 924
Thanks: 0
Thanked 0 Times in 0 Posts
David Eagar is on a distinguished road
Solution

What fixed it for me was pointing the nested subform to a different query, which was not looking for the TR reference

David Eagar is offline   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing data from child form to the original form when both forms are open Mr_Si Modules & VBA 3 12-08-2007 11:57 AM
Splitted MDB created problem with FindAsYouType Gilfdz Modules & VBA 1 11-13-2007 03:14 AM
Split Database (Front / Back end) and create MDE file Cosmos75 General 11 04-04-2003 09:04 AM
execution of form events sarahb845 Forms 0 10-02-2002 12:27 PM




All times are GMT -8. The time now is 09:43 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World