Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3404766
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:25:23+00:00 2026-05-18T05:25:23+00:00

I have a macro in my excel workbook that updates a specific record in

  • 0

I have a macro in my excel workbook that updates a specific record in the access database related to the spreadsheet.

All works fine if the access database is closed. Problems arise if the database is open and a user is editing the specific record that the excel spreadsheet relates to.`
I get the following Error Message:

Error Number 2147467259: 
The database has been paced in a state by user 'ADMIN' on
'LAPTOP' that prevents it from being opened or locked.

I have set the database form’s Record Locks to ‘No Record Locks’ but this hasn’t helped.

Any advice or help is greatly appreciated.

Cheers
Noel

Public Sub updateAccessRecord()
On Error GoTo ProcError
Dim subFuncName As String
subFuncName = "updateAccessRecord"

Dim conn As ADODB.Connection
Dim cmd As ADODB.Command
Dim rst As ADODB.Recordset

Dim dbName As String
Dim dbPath As String
Dim strCon As String
Dim recID As Long
Dim fieldVal As Double
Dim strSQL As String

fieldVal = Worksheets("House Claim").Cells(593, 10).Value
dbName = "claim-db.mdb"
dbPath = ThisWorkbook.Path & "\..\..\..\..\"
dbPath = dbPath & "\" & dbName

strSQL = "UPDATE tblInsClaimDet SET propSet=" & fieldVal & " WHERE ID=" & recID & ""

   Set conn = New ADODB.Connection
   With conn
    .ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;" & _
       "Data Source=" & dbPath
       .Open
   End With
   Set cmd = New ADODB.Command
   With cmd
      .ActiveConnection = conn
      .CommandText = strSQL
   End With
   Set rst = cmd.Execute
   Set rst = Nothing
   conn.Close
   Set conn = Nothing

ExitProc:

   Exit Sub

ProcError:

   MsgBox "Error " & Err.Number & ": " & Err.Description, _
         vbCritical, "Error in procedure in " & subFuncName
   Resume ExitProc
End Sub 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T05:25:24+00:00Added an answer on May 18, 2026 at 5:25 am

    It seems that you have not split the database into a front-end and a back-end. The problem goes away if you do. Ctrl+S is not for saving a record, that is Shift+Enter, it is for saving a database object, and so it seems it has the effect of throwing the database into design or development state.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Excel 2003 workbook that contains a macro to copy certain of
I have an Excel file that has a bunch of VBA and macro code
I have a 'foreach' macro I use frequently in C++ that works for most
I have an excel workbook that is used to track tasks by project. Each
I have a macro that needs to run for update. If Excel is in
I have an excel spreadsheet that contains entire addresses packed in a single cell
I have several excel workbooks that each have a desire spreadsheet that will continually
I have a chart in a Worksheet in Excel and I have a macro
I have written an Excel VBA macro which imports data from a HTML file
I have a macro that I wrote to just help me with my unit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.