Exclusive Access Error

oxidus5886

New member
Local time
Today, 22:56
Joined
May 27, 2009
Messages
6
Hi everyone,

Im having a problem with an error on my database as follows:

"The table 'Cars' is already opened exclusively by another user, or it is already open through the user interface and cannot be manipulated programmatically."

The error appears when I try to move from form "Add Car Parts Form" to form "Add Cars Finish".

The error has only started since I created a subform on the "Add Cars Finish" form.

I am assuming that there must be an error within my code somewhere either on the first or the second form.

As I can't be very specific about where the problem may lie, because I'm clueless :D, I have attached my database. It has no data in it as of yet so there are no sensitivity issues.

Please could someone take a look at this for me to see where I am going wrong.

BTW I am almost a complete noob with both Access and VB coding so please go easy.

Thanks in advance.

Adam

P.S. I am using Access 2007, I had to save as an MDB as I couldn't get the file small enough to post. I'm not too sure if my DB will work properly in the new format.
 

Attachments

Did you do a Compact and Repair in ac2007 first?
 
Hi thanks for your reply,

I am a complete noob, didnt even know you could do that.

I have attached the compacted version of the 2007 database.

By the way just as a point of interest, what is it exactly that compact and repair does? Does it affect the code or the data in any way?

Thanks,

Adam
 

Attachments

Why do you have the PopUp and Modal properties of your forms set to YES?
 
You will also continually have problems until you base (bind) your forms on queries and not tables directly.
 
if you have a record open, with changes made on it, and you open another form based on the same record, then you will get this message if you try to change anything on the popup - you need to save the record before opening the popup form.
 
Hi thanks for your help so far guys!

The error appears when I click on a particular button, the code for the button is displayed below:

Code:
Private Sub Command260_Click()
 
If Me.Dirty Then Me.Dirty = False
 
On Error GoTo Err_AddCarNextButton1_Click
 
Dim stDocName As String
Dim stLinkCriteria As String
 
stDocName = "Add Cars Finish"
stLinkCriteria = "[RegistrationMark]=" & "'" & Me![RegistrationMark] & "'"
 
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormEdit, acWindowNormal
DoCmd.Close acForm, "Add Cars Parts Form", acSaveNo
 
Exit_AddCarNextButton1_Click:
Exit Sub
 
Err_AddCarNextButton1_Click:
MsgBox Err.Description
Resume Exit_AddCarNextButton1_Click
 
End Sub

This button is designed to close one form and open another with the same record being displayed.

The whole idea behind this selection of forms is that it is designed to be a wizard like environment and incredibly simple to use.

The entry of one record is basically spread across multiple forms. So record navigation has been disabled along with most functions whist in form view.

With this in mind it is necessary to keep the user on the same record when jumping from form to form. This is the reason for the link criteria.

I have used a me.dirty statement at the beginning of this button code to save all information so far, is this not sufficient?

The whole system has been fine until I added a subform to the target form of this button. Ever since then the error has been appearing.

The error refers to the "Cars" table but the subform is based on the "Parts" table, which is what I don't understand.

Any more help you guys could provide would be much appreciated.

Thanks,

Adam
 

Users who are viewing this thread

Back
Top Bottom