Is the form that has the command button a form that is bound to the Repair
table? If yes, that is where the locking is coming from. Check this setting
in Record Locks property for the form and be sure that it's set to No Locks.
--
Ken Snell
<MS ACCESS MVP>
http://www.accessmvp.com/KDSnell/
"dkschoonover" <(E-Mail Removed)> wrote in message
news:27174F29-AD86-4242-8E1F-(E-Mail Removed)...
>I have a Make-Table Query "Repair"
>
> When I double click the query to run it, it creates the table
> appropriately.
>
> When I add it to a command button, it causes an error:
> The database engine could not lock table "repairx" because it is already
> in
> use by another person or process."
>
> There is no one else in my test environment.
>
> My code string looks like:
> DoCmd.Close
> DoCmd.OpenQuery stDocName, acNormal, acEdit
> DoCmd.OpenQuery stDocName2, acNormal, acEdit
> DoCmd.OpenQuery StDocName3, acNormal, acEdit
> DoCmd.OpenQuery StDocName4, acNormal, acEdit
> DoCmd.RunMacro "Google Earth Export"
> DoCmd.OpenQuery StDocName6, acNormal, acEdit
> DoCmd.RunMacro "VSAT Validation Export"
> => DoCmd.OpenQuery "Repair", acViewNormal, acAdd
> MsgBox ("Updates Complete")
> DoCmd.OpenForm stDocName9, , , stLinkCriteria
>
> I have tried it as acAdd and acEdit.
>
> Any ideas?