473,803 Members | 3,424 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MS Access crashes when subform is on a tab control AND calculated control used.

8 New Member
I have a problem where if I use a calculated control, for example =Date()) on my form, PLUS I have a subform on a tab control on the same form, then when I refresh the record (by menu command or VBA me.refresh), the DB crashes!

I've stripped the thing right down, and tested with a) no calculated control - no problem, b) no subform - no problem. c) moving the subform off the tab control to a free space on the underlying form - again, the problem disappears. I'm stumped! ... any help gratefully received!
Sep 22 '07 #1
17 18371
ADezii
8,834 Recognized Expert Expert
I have a problem where if I use a calculated control, for example =Date()) on my form, PLUS I have a subform on a tab control on the same form, then when I refresh the record (by menu command or VBA me.refresh), the DB crashes!

I've stripped the thing right down, and tested with a) no calculated control - no problem, b) no subform - no problem. c) moving the subform off the tab control to a free space on the underlying form - again, the problem disappears. I'm stumped! ... any help gratefully received!
Are you Refreshing the Sub-Form directly from the Main Form?
Sep 22 '07 #2
MariaTorvalds
8 New Member
The problem was originally caused by me.refresh being part of the OnCurrent event code on the main form - which contains both the tab control (with subform on one of three pages) and the control containing =Date().

I removed all the form events to track down the problem. The DB crashes either when the main form is refreshed by manually selecting "Refresh" from the standard toolbar (under Records), or when I click a command button on the main form which just does a me.refresh.
Sep 22 '07 #3
MariaTorvalds
8 New Member
Are you Refreshing the Sub-Form directly from the Main Form?
To be specific, it's the main form I'm refreshing, from the main form. The subform has a single master / child link, so it takes care of itself.
This form / subform combination has been used with no problem for some time... it looks like some kind of conflict between the form control calculation firing and the subform doing its thing, with the crash only happening when the subform is on the tab control page. Weird!
I've also imported all the objects into a new database - same problem.
Sep 22 '07 #4
ADezii
8,834 Recognized Expert Expert
I have a problem where if I use a calculated control, for example =Date()) on my form, PLUS I have a subform on a tab control on the same form, then when I refresh the record (by menu command or VBA me.refresh), the DB crashes!

I've stripped the thing right down, and tested with a) no calculated control - no problem, b) no subform - no problem. c) moving the subform off the tab control to a free space on the underlying form - again, the problem disappears. I'm stumped! ... any help gratefully received!
How about removing the calculation in the Control and directly assign a Value to that Control with VBA code. You mentioned =Date() as an example, how about replacing that with VBA code as in:
Expand|Select|Wrap|Line Numbers
  1. Me!![Date Field] = Date()         ' for Main Form
  2.              OR
  3. Me!<Sub-Form Control>.Form![Date Field] = Date()         'for Sub-Form
What happens if you Requery the Main Form instead of Refresh?
Sep 22 '07 #5
MariaTorvalds
8 New Member
How about removing the calculation in the Control and directly assign a Value to that Control with VBA code. You mentioned =Date() as an example, how about replacing that with VBA code as in:
Expand|Select|Wrap|Line Numbers
  1. Me!![Date Field] = Date()         ' for Main Form
  2.              OR
  3. Me!<Sub-Form Control>.Form![Date Field] = Date()         'for Sub-Form
What happens if you Requery the Main Form instead of Refresh?
Hi ADezii - thanks for the suggestions - Requery works OK but I don't want to re-order the records, just ensure the form data is written to the underlying table/s.
I use Refresh in a lot of places, and it's been rock-solid in the past. Given that this innocent command causes a DB crash, I'd be loathed to work around it without knowing why it happens.. something else might trigger a refresh-like process, then I'd be in big trouble.
New info:- it turns out the crash also occurs when the control is unbound, and with no control source specified (so I could do as you suggested and write the value with VBA). If I bind the control with a field, the problem goes away - but I'm gonna land up with a ton of dead fields if I use that workaround, plus I still wouldn't have any idea what's going on.

Just cannot figure why the thing works fine with the subform off the tab control page, but messes up when placed on the tab control page.

To restate the problem a bit more clearly:

If a "requery" is done (by VBA or manual menu selection) when an unbound texbox control is on the main form (or tab control page on main form) AND a subform is on the tab control page, then the DB crashes.

If there is no unbound control on either the main form or tab control form, or if the subform is moved off of the tab control page and onto the underlying form, then "requery" works fine.

I should have mentioned - it's a 2000 - format DB running under 2003.

Very grateful for any further ideas. Thanks.
Sep 23 '07 #6
MariaTorvalds
8 New Member
Hi ADezii - thanks for the suggestions - Requery works OK but I don't want to re-order the records, just ensure the form data is written to the underlying table/s.
I use Refresh in a lot of places, and it's been rock-solid in the past. Given that this innocent command causes a DB crash, I'd be loathed to work around it without knowing why it happens.. something else might trigger a refresh-like process, then I'd be in big trouble.
New info:- it turns out the crash also occurs when the control is unbound, and with no control source specified (so I could do as you suggested and write the value with VBA). If I bind the control with a field, the problem goes away - but I'm gonna land up with a ton of dead fields if I use that workaround, plus I still wouldn't have any idea what's going on.

Just cannot figure why the thing works fine with the subform off the tab control page, but messes up when placed on the tab control page.

To restate the problem a bit more clearly:

If a "requery" is done (by VBA or manual menu selection) when an unbound texbox control is on the main form (or tab control page on main form) AND a subform is on the tab control page, then the DB crashes.

If there is no unbound control on either the main form or tab control form, or if the subform is moved off of the tab control page and onto the underlying form, then "requery" works fine.

I should have mentioned - it's a 2000 - format DB running under 2003.

Very grateful for any further ideas. Thanks.
...sorry..in my last reply (third from last para.) I ment: "....then "refresh" works fine...." not "...requery..." .
Sep 23 '07 #7
ADezii
8,834 Recognized Expert Expert
...sorry..in my last reply (third from last para.) I ment: "....then "refresh" works fine...." not "...requery..." .
For now, you can use the following code as a bandaid until this issue is resolved - just substitute this code for a Refresh:
Expand|Select|Wrap|Line Numbers
  1. Dim strMyBookmark As String
  2.  
  3. strMyBookmark = Me.Bookmark
  4. Me.Requery
  5. Me.Bookmark = strMyBookmark
If you are really pressed for a resolution to this problem, if you are interested, and if it is feasible, you can attach the Database along with a subset of the data, but in its current Error State, to an E-Mail addressed to me. I would be more than happy to look at it for you, if you so desire. If it comes down to this just let me know, and I'll post my E-Mail address. I will not post it until I receive explicit confirmation from you. See you arround.
Sep 23 '07 #8
puppydogbuddy
1,923 Recognized Expert Top Contributor
Verify that Name AutoCorrect is turned off. This bug causes problems on refresh/requery similar to what is happening here.

see this link:

http://allenbrowne.com/bug-03.html
Sep 23 '07 #9
MariaTorvalds
8 New Member
Thanks to ADezii & puppydogbuddy for the advice. I did the object import to a new DB as per Allen Browne's recommendations - no joy.

I was stripping down the DB for ADezii to look at, and the thing started working.

The full story is now:

If the subform is placed on the tab control, AND there's an unbound textbox control on either the main form or the tab control AND the subform records contain a calculated field AND the subform has an "Order by" entry (still with me? :-) ..... then when I hit the main form with a "refresh", the DB goes into what I think Microsoft lovingly call an "infinite recursion" - (I found that wondrous title in Microsoft Article ID. 288374). The description of the symptoms seems to fit.
If I remove ANY of the elements listed above, everything works fine.
Since the easiest thing to change was the "Order by" entry for the subform, (which is now blank), I'm just left to figure out how to sort the continuous records in the subform by some other means.... preferably one which doesn't crash the DB!

The subform calculated control is just giving the product of two other controls.... nothing fancy - and the DB has been working fine with this subform for years.

I'd be grateful if you wiser folk would let me know if you consider this to be a bug, or if I'm just doing things the wrong way. Either way, I recon a few others out there may have been caught by something similar?

Many thanks for the advice thus-far.
Sep 23 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

1
3739
by: Simon | last post by:
Hello All I am trying to build a couple of forms in Access 2000. Whilst I have one form which has all of the contact details in it also generates (using autonumber) a unique id for the customer. I have also created a button to open up another form which looks at a second table. I want the ID automatically populated into the form (tables are designed one to many) so that correspondence can be added. At the moment access states that...
7
1686
by: Julia Baresch | last post by:
Hi everyone, My company recently upgraded from Office 97 to Office XP. As those who've read my other posts know I have a database with 3 nested subforms Main form-->First Subform-->Second Subform First subform is a subform of Main Form, and Second Subform is a subform of First Subform.
3
1670
by: Andrew Wrigley | last post by:
Hi I have what seems a corruption of an mdb that is not solved by the decompile command line trick. The problem appears when clicking on a subform control (check box) that has a event handler associated with it. Everything works ok, until I click on the check box, whereupon Access fails with an application error. It appears that execution never
2
343
by: Claude | last post by:
Let' say we have an application for a production facility running 24/7 broken into 3 shifts 6-2,2-10,10-6 each production report date contains 3 shifts as above in each shift there can be from one to several different product runs (the average is about 4) but it could be more or less - it's not defined or definite for many reasons Then, for each run there is a production report of product, good pieces,
2
1576
by: Steve Jorgensen | last post by:
I have recently had reason to worke on 3 different Access/VBA applications of different sizes on Windows XP machines. In all cases, I've had frequent instances of code changes being discarded, and having to re-write the changes. has anyone else seen this problem? It was pretty embarassing for a while delivering code that worked before I closed Access, then failed upon deployment. I finally developed the habit of copying my code into...
0
1874
by: jphelan | last post by:
I have a subform that works fine until you import it into a new database when it crashes if you try to open it in either disign or form view. The form, "Attendees_Subform" in my application was pattern after the same form used in the MS template, "Event Management.mdb" application that is downloaded from the MS Template Gallery on their website. I narrowed down the problem to the Control Source in the, "Attendees_Subform using the...
3
4582
by: Shannan Casteel via AccessMonster.com | last post by:
I have a subform for listing parts. It has fields including: ClaimID, ITEM, NET PRICE, LIST PRICE, Quantity, Supplier, and a calculated field called Part Total. The subform is based on a query. The Part Total field is calculated as (=.*.). Then there is a hidden text box on my subform that calculates the sum of all the Part Totals for each claim. There is another field on my main form set equal to this field on the subform. My...
2
4035
by: Lenin Torres | last post by:
Hi everybody I have an Union Query that works fine. I used this query as the RecordSource for a Form. That Form is used as a subform in another form. Everything works fine, except for the "Filter by form" feature. When the user tries to use Filter by form a messagebox is displayed: "There are too many controls in this form to perform a filter by form", after that,when the user exit the Filter by Form mode, Access crash, displaying a...
6
5885
by: dhowell | last post by:
I have a "form" and "subform" where I would like a calculated control on the form which sums the values of a datasheet column of the subform. (datasheet on subform may have a variable number of entries) I can't seem to get the calculated control on main form to do what I want...... Is this possible, if so, how? Help!
0
9566
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10300
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
10069
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
9127
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
7607
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
6844
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
5503
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3802
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.