?
Solved

ms access 2010 error 3825 on update query, regarding multi-value

Posted on 2016-09-07
8
Medium Priority
?
80 Views
Last Modified: 2016-09-13
app updates fields (text,Y/N,Memo,dates) in table in db(a). When completed, db(a) deletes a single record in db(b) and runs an update query to insert the data in db(a) to identical fields in db(b). The error occurs on the "docmd.RUNSQL" line below. The error is: error 3825;
"SELECT * cannot be used in an insert into query when the source or destination contains a multi-valued field". I have not created any multi-valued fields that I know of, and don't know how to determine if a field is defined as multi-valued.

vba code:
db.Execute "DELETE * FROM tblJobSpec", dbFailOnError

' Append new data for this Job
JobSpecFileName = DB_Template_Path & "CAC_Field_Surveyor_JobData_Template.accdb"
strSQL = "INSERT INTO tblJobSpec IN '" & JobSpecFileName & "' SELECT tblJobSpec.* FROM tblJobSpec;"

DoCmd.SetWarnings False
DoCmd.RunSQL strSQL
DoCmd.SetWarnings True
...etc,,,
0
Comment
Question by:jsgould
  • 3
  • 3
  • 2
8 Comments
 
LVL 23

Assisted Solution

by:crystal (strive4peace) - Microsoft MVP, Access
crystal (strive4peace) - Microsoft MVP, Access earned 1000 total points
ID: 41788395
is this a query? Even if it is an real table, it is best to qualify * -- Use
DELETE [tablename].* FROM [tablename]

Open in new window

also try CurrentDb.Execute instead of a macro action to run a query
with CurrentDb
   .Execute strSQL
   'do this right now
   DoEvents
   'refresh
   .TableDefs.Refresh
End With 'CurrentDb

Open in new window

0
 
LVL 40

Accepted Solution

by:
PatHartman earned 1000 total points
ID: 41788537
Open each table in design view and examine each column to determine if it is a multi-value field.  If you don't find one, you may have in the past added one to test with and Access is retaining a memory of that field.  In that case, create two new tables from scratch and move over any existing data.  Then rename the original tables and give the replacement tables the names of the originals and try again.
0
 

Author Comment

by:jsgould
ID: 41788555
Pathartman:
how do I tell if its a multi-value field?
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
LVL 40

Expert Comment

by:PatHartman
ID: 41788593
You have to click on the Lookup tab for each field.MultiValue.JPG  Or if it is easier, use the database documenter on the Database Tools tab and print a report that documents all the properties for each table.
0
 
LVL 23
ID: 41788608
adding on:
The free Analyzer for Microsoft Access can also tell you where multi-value fields are .. as well as fields that have RowSource defined in each table (Lookup Fields report)

free Analyzer for Microsoft Access on CodePlex
http://Analyzer.CodePlex.com
Document Access databases.  Reports to show list of tables, data dictionary, form and control properties, and more.
0
 

Author Comment

by:jsgould
ID: 41789638
Thanks for the quick responses. Turns out the error is misleading. The problem is the 2 tables involved in the Insert query are not exact duplicates in field order and the insert * is trying to insert memo into text or vice versa.
0
 

Author Closing Comment

by:jsgould
ID: 41796042
Thank you
0
 
LVL 23
ID: 41796137
you're welcome ~ happy to help
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

864 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