Corrupt Database

tomdee

Registered User.
Local time
Today, 22:53
Joined
Jul 27, 2004
Messages
16
When I try to save the "Main customer details" form from design view access says it has encountered a problem and needs to close. I'm unable to finilise the design of this form and unable to finish this project.

If someone could just tell me whether they can reproduce the problem or not then I would be eternally gratefull.

Grrr... it's no good, I can't even compact repair the database without it crashing, which means I can't get the zip file under 250Kb so I can't even post it here...

Has anyone heard of a problem where you just can't close a form. I'm sure it's nothing I've done, but access just wont let me close my main form. If I go into design view to close it then it just won't let me asave it. Otherwise it crashes... I'm at my wits end.

I've jsut managed to try it on another machine and it's giving me a similar symtoms, no crashing but I just can't close the form.


Many thanks Tom
 
Do not worry about the form ....You may have bigger problems

Now is the time to protect what you have

Open New Database and import all objects into new database

Create a copy of this new database as a backup

Then re create your form


Len B
 
Sounds like you need to Decompile then Recompile the db.

"C:\Program Files\Microsoft Office\Office\msaccess.exe" "X:\YourDatabase.mdb" /decompile
 
Hi,

Thankyou both for your help. I tried the decompile switch but it didn't make any difference. I'm going to try copying the rest of the database to a new one and see if that helps.
How would such a corruption come about and how can I guard against it in the future?

Thanks again
Tom
 
Tom, I am currently working on a simular problem and here's what I ended up doing;

1. First you need to locate the offending record(s). Mine appeared as a record with a wacked out primary key autonumber field.
2. Then I copied the offending table structure to a new table.
3. Next, I created a temp field in the new table to accept the existing pk field.
4. Open the bad table and manualy copy chunks of records and paste them into the new table.
5. Clean up the pk stuff and rename the tables (old table to a temp table and new tables to old table names.

Hope this makes some sense and that you can make something like this work for you...

ken
 
I think I get what you mean however the database I'm using isn't live yet so it only has a small amount of test data in it. I've tried deleting ALL records from my database and still get the same symtoms. The problem form has about 8 sub forms on it, could that be the cause of the problem?


Tom
 
From my experience, I wouldn't guess that to be the direct problem. But 8 subforms may be pushing it a bit. Can you split some of it up from a business process perspective?

ken
 
I've moved evrything over to a new database now (except for the problem form) and redesigned the problem form with a few less subforms. I've got a few buttons that pop up subforms on request and it all seems to be working now, fingers crossed. The solution isn't ideal as the pop-up forms (which are based on queries) don't update their information when I cycle through records on the main form, is there a way to do this? Also the popups always appear the same size and in the same position, this is the behavior I want but the size and position isn't where I want them. Isthere a way to change the default on a form by form basis?

TIA
Tom
 
I think you can just use a requery cmd on the main form when you close your pop-ups. As far a position, you may have to do some API stuff to make it appear at a certain place on the screen.

ken
 
What I'm aiming for is for the information in the pop ups to display details for the record on display in the main form. So, don't I need to requery the popups when I change a record on the main form? How do I cause a "docmd.requery" to be carried on a different form to the one that caused the event?

Tom
 
Try this in the forms/subforms OnOpen event for moving and sizing your forms & subforms...
Code:
'DoCmd.MoveSize [right], [down], [width], [height]
DoCmd.MoveSize 200, 200
You can also resize the form using the same method...
Code:
DoCmd.MoveSize 200, 200, 4000, 3000
Check the help files for the MoveSize method for more info.
 
This might sound weird, but..... I use Access 97, and what happended to me was similar to your situations.... After either entering or editing code (in modules or forms), when I went to compile and save, all you-know-what would break loose. What I discovered was that blank spaces in the code was killing me. Yup, honest to goodness blank spaces in a blank line!

The early way I got around the headache was to copy my source code into a text file, then pull up the text file in Word, turn on the character indicator, and start looking for spaces on those blank lines. Once I found them, I would delete them, and then save the text file, copy it back as the source code and could then save compile.

I believe it was Mile-O-Phile who shot me a neat piece of code that would do all of that for me. Once I find the code (I just changed jobs!!), I'll post it.

But could you imagine??? Blank spaces on a blank line, killing a bunch of code?? Ain't Access great?

Hope the idea helps...... I know it saved my neck.
 
Something else that I found out the hard way - When you delete a control, Access leaves the controls code in the module. It's a good idea to clean the modules of this kind of stuff because it has caused my db's to act wacky in the past...

ken
 
Thankyou all for your help, I've redone the problem form now and it seems so be working but when I've got a chance this evening I'll definetly try out the spaces on blank lines theory and give my code a general tidy up.
Big thanks to ghudson too, the movesize thing was just what I was looking for for the subforms.

Thanks
Tom
 

Users who are viewing this thread

Back
Top Bottom