Form_ApplyFilter problem

C

clh333

I am a developer maintaining and extending functionality of an Access
database(Office 2003 Professional, 2000 mdb file format) used by an
engineering group. They are using this single-copy database across a LAN and
have resisted my urging to split the database into front-end and back-end,
let alone to upgrade to SQL. The database runs a Compact and Repair on
closing, but corruption is still an issue, as you might expect.

Recently I found that a form which had been behaving relaibly was no longer
doing so: the Form_ApplyFilter() sub that I had coded to enable and disable a
command button is no longer changing the state of the button. By entering a
breakpoint and examining the value of the ApplyType argument being passed, I
found that it is always 1 (acApplyFilter), whether the filter is being
applied or removed.

I have an alternate copy of the form from an earlier development state which
behaves properly (passes 0 and 1 accordingly). I imported this form into a
copy of the production database, and it continues to behave properly, while
the mis-behaving form does not. Same database, same tables, same code except
for the extensions added to the newer version. Nothing I can see that would
affect the ApplyType.

I looked in MSDN's library and found material suggesting that the likely
cause is corruption of either the form itself or one of its controls. The
remedy suggested is to reconstruct the form. I can modify the earlier form
if needed, but here is my question:

This is my first known experience with corruption of an Access form. I've
seen plenty of corrupted tables, and a few databases that wouldn't open at
all, but the idea that a form can become corrupt is new to me. Does anyone
else have any experience with this issue? Can anyone suggest an alternate
diagnosis? What else could I do to either diagnose or prevent this
occurrence in the future?

Thank you for your assistance.
 
H

Hunter57

Hi,

I have had some corruption issues occasionally in Forms. Usually it occurs
when I have been writing a lot of code in the form. It can easily happen if
you do not set the Form to be edited in Design View Only. But sometimes it
can happen for some unkown reason. Because it is usually so easy to fix I
don't worry much about it.

Here is how I solve the problem: I just right click on my corrupted form in
the database window, select "Save As" and save the form with the name access
gives it. Next I rename my corrupted form. I usaually just put OLD on the
end of the Form name. Then I rename my new copied form to the original Form
name. The new form has always then worked properly for me.

Best Regards,
Patrick Wood
www.advancingsoftware.com
www.churchmanagesoftware.com
 

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