Close form problem - exits program, keeps lock file

marathonlady

Registered User.
Local time
Today, 08:01
Joined
Jul 10, 2002
Messages
120
I'm having a problem. I close a form in one part of my program and it completely exits me out of the system, but keeps the access lock file out there. In a different part I close a form and it works as it should, the form I came from is displayed and I am not exited out of the system. What am I doing wrong?

Thanks.
 
ML,

What code do use to close the form? (I assume that it's just like the other).

And how Old/Volatile is the form? Is it under constant maintenance (maybe a
Compact/Repair would help)?

Wayne
 
If you could post the code (or macro) that is behind each button.
We would then be able to help a hole lot more.

:)
 
Code for cancel button problem

Here's my code. When the query is run that deletes the record out is when the problem occurs. That happens for a new order that is added. If the order is there and they just want to cancel the changes they made to it, then
it works as it should. Query is "DeleteUnusedOrder".

If Me!New Or Me.Dirty Or Me!Changed Then
Dim Response As Integer
Response = MsgBox("Are you sure you wish to cancel changes to " & Me!ID & "?", 292, "SOTS Cancel Order Editing")
If Response = 6 Then 'yes, cancel the change

'TODO: Undo all changes to steps and work orders
Form_WorkingClearanceMainFormPIC.Visible = True

DoCmd.SetWarnings False

If Me!New Then
DoCmd.OpenQuery "DeleteUnusedOrder", acViewNormal, acEdit

Else
Me.Undo
End If

DoCmd.Close acForm, "WorkingClearanceEditForm"

End If

Else
DoCmd.Close acForm, Me.Name, acSaveYes

End If
 
Close quits for me too

If anyone has a solution for this, I'd be interested also. It's just started happening with my database also, on forms and reports - sporadically not consistently.

The only thing I can think of in my case, is that I've recently loaded Visual Basic .Net and related files. Could this have made a difference?

Currently using Access 2000 on WinXP (SP2) and about to upgrade to Access 2003, which hopefully will fix the problem.
 
Close Form

It's in the code.

Me.Close AcForm closes the form and just that. It doesn't close the Db which is why the lock file is still there. If you want to close the Db then DoCmd.Quit
 
Unfortunately, the close command seems to sometimes quit the database, as does the close button on the top right hand corner of the form, as does the close command on the file drop down menu - again, just since I loaded visual basic - I figure it must be related.

I don't want to quit, I just want the form or report to close. I haven't changed the code and it only happens (with the same database - and I mean the exact same database) on my desktop, not my laptop. Hence there is a culprit lurking somewhere on the system on my desktop.

I'll probably never figure it out - I found it curious that someone else has the same problem.
 

Users who are viewing this thread

Back
Top Bottom