By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,652 Members | 1,995 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,652 IT Pros & Developers. It's quick & easy.

MsAccess 2007 Strange behaviour

P: 2
Hi all,

I developed an application where within one main form 3 subforms are used. 1. Documents, 2. Items within a document, 3. optional Table data if the item represents a table type item. All this is conducted by meta data determining what items should be loaded when a document is created or selected. There is no parent child relation defined between any of the forms/subforms.
The app is used by 80 to 100 users.
For 6 years everything went well.
Since migrated to win7 office 2007, a strange non debuggeable behaviour occurs. When the users switches between a table type item A and another B, as expected each time he clicks on A or B, the 3rd subform shows the data and structure of the related table data as defined by the meta data. When the user clicks inside the 3rd subform, focus is set to the content of that table. Until suddenly, after several switches between table A and B, and clicking again in the 3rd subform, subform 2 triggers, out of the blue, a form.current back to the previously selected table item. When debugging there appears to be no code execution preceding this event. Hence, I have no clou where it comes from. I already checked the app code on simultanious conflicting data access through forms and recordsets. Dirty status is used to avoid pending status of data. I also checked on possible conflicts in naming of public functions and subs, global variables etc. Decompiling, rebuilding by import into a fresh db etc did not resolve the problem.
Does anyone know about something similar related to MsAccess 2007 itself or service packs?
Nov 29 '11 #1
Share this Question
Share on Google+
3 Replies

Expert 2.5K+
P: 3,072
Hi Marc,

It's not the code, but the sequence of the form events that's changed in A2007. Had to change some of my Access applications too to get them working as designed in A2003.

Would advise you to start using (hidden) fields on the form to link the three subforms, thus making it "event undependent".

This works by setting the value of a (hidden) keyfield in the OnCurrent event of the subform and linking the other subform to that filled (hidden) keyfield in the linkage fields of the other subform.

Getting the idea ?

Nov 29 '11 #2

P: 2
Hi Nico,

Thx for the fast reply. I will look into it asap.
I suppose you mean that I should simulate the current event and thus avoid it?
As I understand, the event of subform A sets a field on the main form which in turn triggers an event on the second subform B. That means that the subform should be polling for a change in the timer event?
Nov 29 '11 #3

Expert 2.5K+
P: 3,072
Try to avoid use of the timer, it messes up things...

The process in steps:
1) Place the unique ID of subform1 on the main form and fill it in the Subform1.OnCurrent.
2) Arrange the linkage fields of subform2 to be linked to this unique ID of subform1
3) Place the unique ID of subform2 on the main form and fill it in the Subform2.OnCurrent.
4) Arrange the linkage fields of subform3 to be linked to this unique ID of subform2

This should be all. Now only the OnCurrent is used and no other form events can mess up things.

Nov 29 '11 #4

Post your reply

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