Solved

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

Posted on 2016-09-07
8
33 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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

759 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

17 Experts available now in Live!

Get 1:1 Help Now