Solved

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

Posted on 2016-09-07
8
35 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 19

Assisted Solution

by:crystal (strive4peace) - Microsoft MVP, Access
crystal (strive4peace) - Microsoft MVP, Access earned 250 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 34

Accepted Solution

by:
PatHartman earned 250 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
 
LVL 34

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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 19
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 19
ID: 41796137
you're welcome ~ happy to help
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

863 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

21 Experts available now in Live!

Get 1:1 Help Now