Program terminates

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

Guest

I am using a db w/menu, forms, queries, etc. that I wrote on my standalone
PC, no network, Access 2002, SP3. Every once in a while (appears to be
random) when I save a record after entering or editing info, Access
terminates completely.

The "save" button on my form does this: RunCommand acCmdSaveRecord

I have Access set up to compact my db when I quit, but this doesn't happen -
the form closes, the menu closes, and Access closes - all in the blink of an
eye. All data is intact, even the most recently added or changed so I'm not
losing anything but patience!

Any ideas?
 
Hi Trillian,

I have found in the past that using RunCommand is not always 100% reliable.
You might want to try setting the form's dirty property to false instead.
This has the same effect. Here is an example:

Private Sub cmdSave_Click()
On Error GoTo ProcError

If Me.Dirty = True Then 'Save the record
Me.Dirty = False
End If

ExitProc:
Exit Sub
ProcError:
MsgBox "Error " & Err.Number & ": " & Err.Description, _
vbCritical, "Error in cmdSave_Click event procedure ..."
Resume ExitProc
End Sub


If you are still having troubles, then you may have some slight corruption
going on. Post back if that is the case.


Tom

http://www.access.qbuilt.com/html/expert_contributors.html
http://www.access.qbuilt.com/html/search.html
__________________________________________
 

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

Back
Top