Access 2007 subform

G

Guest

I have an Access 2000 application I am trying to run in 2007. I even tried
converting it to 2007 but have a problem that will not go away.

One form has a number of tabs. Each tab has an unbound subform to update
reference data like drop down lists. When I try to open it in 2007, the form
locks up. It shows "Calculating..." in the bottom of the screen and freezes.

It all works fine in 2000, 2003, etc but not 2007. I just found out someone
else using the same program in 2007 is not having issues. Could it be a
security issue? I am using workgroup security which I know has been dropped
in 2007.
 
A

Allen Browne

No. The kind of form you describe works fine in A2007.

Make sure you have trusted the folder where your database resides:
Office Button | Access Options | Trust Center | Trust Center Settings

Make sure your code compiles okay (Compile on Debug menu, in code window),
and your references are fine:
http://allenbrowne.com/ser-38.html

You might also try a decompile. Close Access. Make a backup copy of the
file. Decompile the database by entering something like this at the command
prompt while Access is not running. It is all one line, and include the
quotes:
"c:\Program Files\Microsoft office\office\msaccess.exe" /decompile
"c:\MyPath\MyDatabase.mdb"
Then compact the database:
Office Button | Manage | Compact/Repair

Most applications need a way to manage all the little lookups, so the form
you describe is quite a common approach. What I personally do is to use a
single subform that sits directly on the main form below the tab control
(i.e. not in the pages of the tab control.) Then use the Change event of the
tab control to set the SourceObject of the subform control, so it loads a
different form when you choose a different tab page. The advantage of this
approach is that the form loads fast and uses less memory, since only one
subform is actually loaded at a time.
 
G

Guest

Hi Allen
Tried the trusted zone, decompile and compile but still having problems.
Weird thing is I tried opening subforms on their own and they seem to be OK.
Did not test all of them as there are 20. Then created a blank form and
tried to put one of the subforms into it. Some work and some don't. For
example, one that just reads a people table works fine as a form on it's own
but when you put it in a new blank subform, it freezes the form.
 
A

Allen Browne

Hmm. Something else must be going on here.

I think your main form is unbound, so hopefully there's nothing in the
LinkMasterFields/LinkChildFields properties.

Presumably you don't have a source query for these forms that refers to the
form itself, e.g.:
[Forms].[Form1].[Text0]
Since subforms are not open in their own right, that would not work. (Should
result in a parameter dialog.)

Perhaps the forms are partially corrupt. You could try this with one of the
forms that doesn't work:
1. Copy any code from its module out to Notepad, and save.

2. Set the form's HasModule property to No. Save.

3. Compact the database again.

4. Export the form to a text file:
SaveAsText acForm, "Form1", "C:\MyFolder\Form1.txt"

5. Delete the form, and compact again.

6. Recreate the form from the text file:
LoadFromText acForm, "Form1", "C:\MyFolder\Form1.txt"

7. Paste the code back into its module.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top