access crashes when form is filtered

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When I filter for a subgroup from my main form, I can use about 4 or 5 macros
and then Access "crashes" -- it seems that if I do not apply the filter, the
macros work fine. Please help!
 
Could be a bunch of reasons, but if this is Access 2002 or 2003, and the
form has a subform, the crash could be due to this bug.

If you have a subform in these versions, and the field named in the
LinkChildFields property of the subform is not represented by a control on
the subform, the references is to an object of type AccessField. This type
seems to have a bug that crashes Access. You can work around the bug by
adding a text box for this field to the subform, so that the LinkChildFields
refers to an object of type TextBox instead.

The process is:
1. Uncheck the boxes under:
Tools | Options | General | Name AutoCorrect
Explanation of why:
http://allenbrowne.com/bug-03.html

2. Compact the database to get rid of this junk:
Tools | Database Utilities | Compact

3. Add a text box to the subform, bound to the foreign key field. (Set its
visible property to No if desired.)

4. In the main form, delete the LinkMasterFields and LinkChildFields
properties of the subform control. Save. Close the form.

5. Open the form again, and set the LinkMasterFields and LinkChildFields
properties again, so Access makes the association with the text box in the
subform.

If that is not the issue you are experiencing, make sure you have the recent
patch for your version of Access and also for JET 4. Both are available
from:
http://support.microsoft.com/gp/sp

If that still does not solve the problem, post back indicating the version
of Access you are using.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

in message
news:[email protected]...
 
It worked - for a little while, then it started crashing again.

The database was created in 2000, and I have upgraded it to 2003 to see if
that would correct the problem. Making sure the master/child links are
correct in 2003 corrected the problem initially, but after I worked on it for
a little while, it crashed again.

Any ideas?

thanks-
 
Okay, so perhaps there is more wrong here.
A decompile might solve it.

Try this sequence:

1. Uncheck the boxes under:
Tools | Options | General | Name AutoCorrect
Explanation of why:
http://allenbrowne.com/bug-03.html

2. Compact the database to get rid of this junk:
Tools | Database Utilities | Compact

3. 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"

4. Open Access, and compact again.

5. Open a code window.
Choose References from the Tools menu.
Uncheck any references you do not need.
For a list of the ones you typically need in your version of Access, see:
http://allenbrowne.com/ser-38.html

6. Still in the code window, choose Compile from the Debug menu.
Fix any errors, and repeat until it compiles okay.

At this point, you should have a database where the name-autocorrect errors
are gone, the indexes are repaired, inconsistencies between the text- and
compiled-versions of the code are fixed, and reference ambiguities are
resolved.

If it is still a problem, the next step would be to get Access to rebuild
the database for you. Follow the steps for the first symptom in this
article:
Recovering from Corruption
at:
http://allenbrowne.com/ser-47.html
 
I think that this suggestion and the previous suggestion worked for the most
part. I also ended up recreating the one form that was still giving me
problems and - at least right now - it seems to be working. Thank you very
much for your help! I would never have gotten the fixes without your help!
 
Back
Top