Solved

Error 3113 Cannot Update "PercentagesFortBenningEMI'; field not updateable

Posted on 2013-06-29
1
412 Views
Last Modified: 2013-06-29
I have code that imports data from Excel to a Access table. I have the same code for other tables to import and they work fine.  when I click on the button to Import data I get this Message"Error 3113 Cannot Update "PercentagesFortBenningEMI'; field not updateable".

I checked the fields and they are the same. So I dont know what to check next. Any suggestions experts? Thank you for your time and help in advance!

I can import the data in by using the dab in Access for external data . Which seems like it shouldnt work if the import button is not working.

Below is the code.



DoCmd.SetWarnings False

Dim DailyReportmsgbox As String
DailyReportmsgbox = MsgBox("You are about to update data and delete Old Data .Do you want to continue?", vbInformation + vbYesNo, "Export Data")

If (DailyReportmsgbox = vbYes) Then
DoCmd.OpenQuery "qryDeleteFortBenningEMIOnly"
DoCmd.OpenQuery "qryDeleteScopeUnitFortBenningEMIOnly"
MsgBox "Delete Records Successful!"

'Import new Data
DoCmd.TransferSpreadsheet transfertype:=acImport, tablename:="tblScopeUnitFortBenningEMIOnly", FileName:="C:/ExportFolder/tblScopeUnitFortBenningEMIOnly.xlsx", HasFieldNames:=True
DoCmd.TransferSpreadsheet transfertype:=acImport, tablename:="qryPercentageFortBenningEMIOnly", FileName:="C:/ExportFolder/qryPercentageFortBenningEMIOnly.xlsx", HasFieldNames:=True


MsgBox "Import Successful!"

ElseIf (DailyReportmsgbox = vbNo) Then
MsgBox "Action Aborted!"

Exit Sub




End If

'Delete old data from import
If Len(Dir("C:\ImportFolder\tblScopeUnitFortBenningEMIOnly.xlsx")) > 0 Then
Kill ("C:\ImportFolder\tblScopeUnitFortBenningEMIOnly.xlsx")
   
If Len(Dir("C:\ImportFolder\qryPercentageFortBenningEMIOnly.xlsx")) > 0 Then
Kill ("C:\ImportFolder\qryPercentageFortBenningEMIOnly.xlsx")

MsgBox "C drive Deleted!"
End If
End If
End Sub
0
Comment
Question by:gigifarrow
1 Comment
 
LVL 61

Accepted Solution

by:
mbizup earned 500 total points
ID: 39286671
It looks like you are trying to import data into a query, not a table.

 Try rewriting your code to update the table(s) directly.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
view mode vs edit mode 17 47
DSum for Access 6 43
Cross Tab with two column values 7 32
I need to be able to get MAX(date)-1 from table. 4 24
The canonical version of this article is on my web site here: http://iconoun.com/articles/collisions/ A companion presentation is available here: http://iconoun.com/articles/collisions/Unicode_Presentation.pdf
Article by: Leon
Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now