Form Keeps Closing

R

rmcompute

I set up a form to select a specific report from a dropdown list. When the
report is clicked, a script issues code to enable specific selection
criterion options on the screen: Me.OptScreen.Enabled = True etc.

Every time the above code is hit the following happens:

Microsoft Office Access has encountered a problem and needs to close. We
are sorry for the inconvenience.

Any ideas or is the database just damaged ? I tried compact and repair but
it doesn't seem to solve the problem.
 
P

pietlinden

could be the form is corrupted a little. What happens if you:
1. copy the code somewhere (like notepad) for safe keeeping
2. run a compact/repair on the db.
3. import all objects to a new db and repair that (to flush out
corruption).
4. paste stuff back into form code and retry
 
R

rmcompute

Yes. That was it. I copied the form to a new name, compacted and repaired
the database, and then re-named the copied form to the original name and it
worked.

I think what caused the problem was that the original form was imported from
another database and then re-named, there was probably something internally
on that form that remained with the old name and caused the problem.

Thank you.
 
Top