ACCESS 2010 Update Query Not Working (1 Viewer)

BLUDEV

Registered User.
Local time
Today, 01:55
Joined
May 1, 2012
Messages
20
Trying to perform a basic update query; tables reside in two different databases. Has been working for weeks and today, it doesn't work. As of today, I get a "Enter parameter value" which does not make since to me. :banghead::banghead::banghead: See below

I've attached screen shots. Is there an issue with 2010 Access that is causing this? How can I get around it?

ADDED:
To make this more interesting, when I change it to a SELECT query, I'm able to update the records. Not sure why it stopped working but please note -

SELECT QUERY
SELECT DISTINCTROW Issues.Description, [TBL003_Combined Data].[ISSUES DESCRIPTION], Issues.Comments, [TBL003_Combined Data].[REF ID], Issues.[Store Number], [TBL003_Combined Data].NOTES
FROM [TBL003_Combined Data] INNER JOIN Issues ON [TBL003_Combined Data].[DARKO CS REF #] = Issues.ID;

UPDATE QUERY
UPDATE DISTINCTROW [TBL003_Combined Data] INNER JOIN Issues ON [TBL003_Combined Data].[DARKO CS REF #] = Issues.ID SET Issues.Description = [TBL003_Combined Data].[ISSUES DESCRIPTION], Issues.Comments = [TBL003_Combined Data].[REF ID], Issues.[Store Number] = [TBL003_Combined Data].[NOTES]
WHERE (((Issues.Description) Is Null));
 

Attachments

  • SCREEN SHOT1- Update Query (2).zip
    149.7 KB · Views: 128
  • SCREEN SHOT1- Update Query.zip
    151.1 KB · Views: 195
Last edited:

MarkK

bit cruncher
Local time
Yesterday, 22:55
Joined
Mar 17, 2004
Messages
8,179
I wouldn't update multiple tables in one query. I wouldn't update using DISTINCTROW. DISTINCTROW allows you to merge repeating data in your results, but in an update, it leads to ambiguity as to which row should be updated.

Did you ever get that IN clause working? How close did you get? Is this still the same problem?
 

BLUDEV

Registered User.
Local time
Today, 01:55
Joined
May 1, 2012
Messages
20
Hi MarkK, this is different; for the IN clause in the other, I'm coming into a glitch still but will update my other post with that. For this, it was working and just stopped. I went into the query design to do a basic update so can you advise a solution to avoid the sometimes working; sometimes not?
 

MarkK

bit cruncher
Local time
Yesterday, 22:55
Joined
Mar 17, 2004
Messages
8,179
Well, the Enter Parameter Value prompt occurs when a field in the SQL statement does not exist in the table. The SQL parser/compiler, since it can't find the field, assumes it's a parameter, and then when the query is executed, it can't find a value for the parameter.

So for sometimes working, sometimes not: If you aren't changing the query, are you changing out the table? But the cause is that a field in the SQL is not being found in the table.
 

BLUDEV

Registered User.
Local time
Today, 01:55
Joined
May 1, 2012
Messages
20
Thanks MarkK; I haven't changed the original query nor changed to destination table. I reviewed some other sites and decided to just do a temp table to contain the data that will be used to update the table in the other database. It's a work-a-round for now until I can figure out why it can't find the field all of a sudden.

Thanks for your support and patience.
 

BLUDEV

Registered User.
Local time
Today, 01:55
Joined
May 1, 2012
Messages
20
I tried updating my VBA code as follows and still no luck:

Function UpdateIssuesDatabase()
Dim dbs As Database
Dim qdf As QueryDef

' Path to database to update
Set dbs = OpenDatabase("\\MACSERV8\Company\Customer Service\Issues FE File\090314\Issues.accdb")

' Update records in Issues table with data from CLIENT RESIDUAL ORDERS (current database)
dbs.Execute "UPDATE Issues " _
& "SET Issues.Description = [TBL003_Combined Data].[ISSUES DESCRIPTION], Issues.Comments = [TBL003_Combined Data].[REF ID], Issues.[Store Number] = [TBL003_Combined Data].[NOTES] " _
& "FROM Issues INNER JOIN(ID " _
& "INNER JOIN Issues " _
& "ON Issues.ID = " _
& "[TBL003_Combined Data].[DARKO CS REF #] ) " _
& "WHERE Issues.Description Is Null;"

dbs.Close
End Function
 

Users who are viewing this thread

Top Bottom