469,955 Members | 2,544 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,955 developers. It's quick & easy.

Form not opening completely

183 128KB
I now have a very tricky problem. I have a form in my Access application which sometimes - perhaps once every 5 to 10 times, though it is not consistent - does not open completely. Specifically, when opened it displays the header section and a skeletal version of the footer section (i.e. text boxes but no data), but the detail section is completely blank. As far as I know this is the only one of the 70+ forms and subforms in the application which behaves in this way.

The form is normally opened by the statement DoCmd.OpenForm strArgument, acNormal, , , acFormAdd in a switchboard event procedure. In the form's property sheet the default view on opening is Single Form, and Allow Form View is set.
Debug.Print statements in the various event procedures of the form opening sequence (Open - Load - Resize - Activate - Current) (which contain no other code than the debug.print statements) show that when the form opens incompletely the Open, Load, Resize and Activate events occur, but not the Current event. After the Activate event the form is displayed with a blank Detail section.

Compact and Repair, Decompile and recompile don't help. It's doesn't appear to be data-related because I have had it occur with three different users' back end data files.

Sounds like either a tricky hardware problem or a timing issue, right? But it's not hardware, because it has occurred repeatedly on two different computers (mine and the user's) in different locations running different compiled and uncompiled versions of the DBMS. I have also caused long pauses in each of the above-mentioned event procedures (by inserting MsgBox statements there), and it didn't make any difference. Neither did Google turn up anything helpful.

I don't expect anybody to be able to solve this with such scanty information, but can anyone suggest any further way I might be able to tackle the problem or get further information? Or has anyone seen any similar behaviour?
4 Weeks Ago #1

✓ answered by NeoPa

Hi again Petrol.

This sounds very much like it may be that hardest of problems to diagnose - a corruption.

If it's not too difficult then re-create it from scratch. If it really is then try saving it to a text file and reloading it. Here's an example of what that might look like :
Expand|Select|Wrap|Line Numbers
  1. Call SaveAsText(acForm, "MyFormName", "C:\TempFolder\FormName.Txt")
  2. Call LoadFromText(acForm, "MyFormName", "C:\TempFolder\FormName.Txt")

6 8563
NeoPa
32,233 Expert Mod 16PB
Hi again Petrol.

This sounds very much like it may be that hardest of problems to diagnose - a corruption.

If it's not too difficult then re-create it from scratch. If it really is then try saving it to a text file and reloading it. Here's an example of what that might look like :
Expand|Select|Wrap|Line Numbers
  1. Call SaveAsText(acForm, "MyFormName", "C:\TempFolder\FormName.Txt")
  2. Call LoadFromText(acForm, "MyFormName", "C:\TempFolder\FormName.Txt")
4 Weeks Ago #2
Petrol
183 128KB
Hmm, yes. I suspected I might have to recreate the form. I guess I can simply copy the controls one by one from the existing form to a new one.
Thank you again, Ade.
3 Weeks Ago #3
NeoPa
32,233 Expert Mod 16PB
Do them one at a time and check that it still works between each.

Alternatively, the SaveAsText() & LoadFromText() approach may be quicker & should work. Worth a try first before going through the far more long-winded approach ;-)
3 Weeks Ago #4
jimatqsi
1,263 Expert 1GB
What is the record source? Are you sure there is data available when this is happening? It sounds to me like the form is fine but there are no records found in the recordsource. Is the form sensitive to the status of the data such that the timing of events may present you with moments when there is no data present?
3 Weeks Ago #5
Petrol
183 128KB
Thanks, Jim, no, the record source is good and stable - it is the main members list and has thousands of entries - and in any case the form is opened to add new members. It opens correctly most times but only partially now and then, so I think that as NeoPa implies it's just one of those funny little Access glitches. I'll rebuild the form as NeoPa suggests, but thanks for your suggestions too.
I must admit I hadn't thought of doing it through SaveAsText() and LoadFromText().
3 Weeks Ago #6
NeoPa
32,233 Expert Mod 16PB
That was just something another MVP came up with very recently for someone else so I suggested it here. It seems a quicker way of recreating just the fundamentals of such an object. Glad to hear it worked for you :-)
3 Weeks Ago #7

Post your reply

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

Similar topics

8 posts views Thread by Emily Jones | last post: by
1 post views Thread by kevcar40 | last post: by
4 posts views Thread by garyusenet | last post: by
2 posts views Thread by str1ker | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.