[AccessD] Error 3188 Could not update; currently locked by another session on this machine

Rocky Smolin rockysmolin at bchacc.com
Mon Jan 14 12:33:49 CST 2013


I forgot the comment out of the line "DoCmd.RunCommand acCmdDeleteRecord" on
the second version.  In the program there was only one delete happening in
each version.  Neither one works.  

In the first version with Docmd.RunCommand, I get the error 3188.  In the
second version with db.Execute I get no error - can step right through the
code - but the record is not deleted.  Only one table is involved.  

BTW - the form is bound to tblCompany.

The PK of the table I'm trying to delete the record from appears as an FK in
two tables - tblPerson and tblBidJob.  The relationship to tblPerson has
Cascade Delete set to true.  The link to tblBidJob does not.  

If I set both links to Cascade Delete = True I get the same error
If I set both links to Cascade Delete = False I still get the error.

Thanks and HTH

Rocky Smolin
Beach Access Software
858-259-4334
www.bchacc.com
www.e-z-mrp.com
Skype: rocky.smolin
 


-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Charlotte Foust
Sent: Monday, January 14, 2013 10:13 AM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Error 3188 Could not update; currently locked by
another session on this machine

Rocky,

Which record is not being deleted?  You're doing two deletes, so does either
one work?  If not, do you have relationships defined in both front and back
end?  Are both tables in the back end or is one local?  Are there any other
relationships to tblCompany that might prevent the operation?

Charlotte



On Mon, Jan 14, 2013 at 9:51 AM, Rocky Smolin <rockysmolin at bchacc.com>wrote:

> Dear List:
>
> I have an app generating the subject error when trying to delete a record.
> I'm running this locally (FE and BE) and I'm the only one running it.
>
> The previous version of this app does not have the error.  So 
> something I changed in the process of doing the client's latest wish list
created it.
>
> I imported the opening form, main menu, and form that throws the 
> error, and a module of Public functions from the previous version 
> which works and it still generates the error.  So it's not in those forms
or module.
>
> (No unfortunately, I did not document each of my changes. :(((( )
>
> the code is pretty simple:
>
> Private Sub cmdDelete_Click()
>
> On Error GoTo IsIt3200:
>
> intReply = MsgBox("Are you absolutely certain that you want to delete 
> this Company record?", vbYesNo) If intReply = vbNo Then Exit Sub
>
> DoCmd.RunCommand acCmdDeleteRecord
>
> Me.cboCompanies.Requery
>
> Exit Sub
>
> IsIt3200:
>
> If Err.Number = 3200 Then
>     MsgBox "Company cannot be deleted as it is being used in one or 
> more Jobs/Bids", vbExclamation
>     Exit Sub
> Else
>     MsgBox "Error: " & Err.Number & " - " & Err.Description
>     Call cmdExit_Click
> End If
>
> End Sub
>
> trapping the condition if the company PK is an FK in any Job in tblJobs.
>  So
> I tried using db.Execute like this:
>
> Private Sub cmdDelete_Click()
>
> On Error GoTo IsIt3200:
>
> intReply = MsgBox("Are you absolutely certain that you want to delete 
> this Company record?", vbYesNo) If intReply = vbNo Then Exit Sub
>
> Set db = CurrentDb
> db.Execute "Delete * FROM tblCompany WHERE CompanyID = " & 
> Me.CompanyID Me.Requery
>
> DoCmd.RunCommand acCmdDeleteRecord
>
> Me.cboCompanies.Requery
>
> Exit Sub
>
> IsIt3200:
>
> If Err.Number = 3200 Then
>     MsgBox "Company cannot be deleted as it is being used in one or 
> more Jobs/Bids", vbExclamation
>     Exit Sub
> Else
>     MsgBox "Error: " & Err.Number & " - " & Err.Description
>     Call cmdExit_Click
> End If
>
> End Sub
> '
>
> Generates no error but doesn't delete the record.
>
> Any ideas what I might have done to break my app?
>
> MTIA
>
> Rocky Smolin
> Beach Access Software
> 858-259-4334
> www.bchacc.com <http://www.bchacc.com/> www.e-z-mrp.com 
> <http://www.e-z-mrp.com/>
> Skype: rocky.smolin
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com



More information about the AccessD mailing list