Access prompts to save form but doesn't actually save

C

Carl

I'm developing a little Access-based system that runs a few lines of VB code.
Today, the VB code hung and the only way I could get it killed was by doing
a hard reboot (Yes, OF COURSE I'm running W98... ;-)). Anyway, when I
restarted the database it hadn't saved my changes, so I redid them and closed
the form. "Do you want to save changes" Yes! Nothing happens... I close
again, reply yes to the prompt and nothing happens. Finally I answer no, the
form closes and yes, it is not saved... So I try to copy and paste the new
form - no problem. I open it, change some, but it won't save. I then
repaired and compacted the db - no help. I created a new db and imported the
objects - same again: no save. I copied the db to the local disc, repeated
the sequence above - no change. What to do, what to do...?
 
S

solex

Compact and Repair your database.

if that does not work start a new database and import your objects from the
old database.
 
C

Carl

If you would have actually read thru what I asked, you would have seen that I
DID repair/compact the database (three times to be sure) AND create a new
database into which I imported the objects. Still I can't 'save as' or 'save
changes', which is kind of odd, since I can create brand new objects of all
kinds. So thanks, but c'mon, give me a better shot... :) I think the key is
that it was VB-code that hung and that I pulled the plug instead of waiting
for W98 to return some kind of fail-message. Then, who can wait that long...
;-) So: Can a library get f-cked up from something like that? References?
Lock files? What function in Access can act to create a situation where I
can't save existing objects? Before you all scream "networks" - I'm on my
home PC now, which is VERY stand-alone...

/Carl

"solex" skrev:
 
K

Ken Snell [MVP]

Try a decompile of the database (make a backup copy first) by running this
command line:

"PathToACCESS\msaccess.exe" /decompile "PathToYourFile\Filename.mdb"

If that doesn't fix it, the form likely is corrupted and you'll need to
rebuild it, or get a copy from a backup that was made prior to the problem
occurring.
 
J

John Vinson

I'm developing a little Access-based system that runs a few lines of VB code.
Today, the VB code hung and the only way I could get it killed was by doing
a hard reboot (Yes, OF COURSE I'm running W98... ;-)). Anyway, when I
restarted the database it hadn't saved my changes, so I redid them and closed
the form. "Do you want to save changes" Yes! Nothing happens... I close
again, reply yes to the prompt and nothing happens. Finally I answer no, the
form closes and yes, it is not saved... So I try to copy and paste the new
form - no problem. I open it, change some, but it won't save. I then
repaired and compacted the db - no help. I created a new db and imported the
objects - same again: no save. I copied the db to the local disc, repeated
the sequence above - no change. What to do, what to do...?

You've tried the normal things... try something undocumented. Back up
the database, of course! Then open the VBA editor and in the Immediate
window type

Application.SaveAsText(acForm, "MyFormName",
"C:\SomePath\MyFormName.txt")

This will write out a cryptic (but interesting to view in Notepad,
just don't edit it!!) text file defining the entire structure of the
form.

Then I'd suggest creating a new database, importing everything EXCEPT
this form, and doing Application.LoadFromText with the same parameters
to import the text file.


John W. Vinson[MVP]
 
S

solex

Carl,

Sorry about that sometimes I just get in the mode of reading the first few
lines when I am very busy.

Have you tried opening up the code window and making a simple change to the
code and then recompile the entire app. Sometime this will point to a
problem in the code. But as Ken has suggested you can try to decompile
(which has helped me in the past).

Access is a bit flaky in the coding area and does not clean up after it self
and sometimes this happens. To be sure that you do not run into problems in
the future I would suggest that you split your database (if you have not
already)
 
S

solex

Carl,

Sorry about that sometimes I just get in the mode of reading the first few
lines when I am very busy.

Have you tried opening up the code window and making a simple change to the
code and then recompile the entire app. Sometime this will point to a
problem in the code. But as Ken has suggested you can try to decompile
(which has helped me in the past).

Access is a bit flaky in the coding area and does not clean up after it self
and sometimes this happens. To be sure that you do not run into problems in
the future I would suggest that you split your database (if you have not
already)
 
C

Carl

Aha! I too can leave incomplete information... ;-) Forgot to tell y'all
that when I try to open the code window either 1) the corrupted form opens in
design mode, or 2) nothing visible happens... (Nothing invisible either -
checked active processes and the VB editor doesn't even twitch...)

/C

"John Vinson" skrev:
 
J

John Vinson

Aha! I too can leave incomplete information... ;-) Forgot to tell y'all
that when I try to open the code window either 1) the corrupted form opens in
design mode, or 2) nothing visible happens... (Nothing invisible either -
checked active processes and the VB editor doesn't even twitch...)

Can you open the VBA editor on something ELSE?

It sounds like this form is irretrievably corrupt. I'd suggest
importing everything else into a new database and build the form from
scratch.

John W. Vinson[MVP]
 
Top