Select Query By design Can Not Convert To Update Query !

Select Query By design Can Not Convert To Update Query !

After I Designed my Select Query and checked it getting the required data, I tried to Convert it to become Update. First it did not ask me for the table to update, as normally should do. I tried to define the destination table fields, but it is not recognizing the destination table or its fields.
Upon saving, it clears every thing!

Any help will be highly appreciated.
Issa S.Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Post the SQL of the query.
Dale FyeOwner, Dev-Soln LLCCommented:
Sounds like corruption.  Backup the database, then perform a compact and repair.
Issa S.Author Commented:
In Fact I did the Compact minutes before this thing started.
First time I face something like this.
Below is the select SQL for your kind inspection and advice. . . . Thanks.

SELECT collects.ID, collects.voucher, collects.dname, collects.cname, collects.payment, collects.usamount, collects.Date, collects.voucher, collects.sanad, collects.amount, collects.retvalue, collects.daccount, collects.caccount, collects.remarks, collects.chno, collects.chdate, collects.withdr, collects.withdrb, collects.branch, collects.nome, collects.salesm, collects.collection, collects.times, collects.chdate, collects.chdate
FROM [Get Old Cheque ID LAST One] INNER JOIN collects ON [Get Old Cheque ID LAST One].MaxOfID = collects.ID
ORDER BY collects.ID DESC;
Ensure Business Longevity with As-A-Service

Using the as-a-service approach for your business model allows you to grow your revenue stream with new practice areas, without forcing you to part ways with existing clients just because they don’t fit the mold of your new service offerings.

Dale FyeOwner, Dev-Soln LLCCommented:
Although I doubt it makes a difference here, "Date" is a reserved word.  I recommend that you make that field name more descriptive if you can (like you did with chDate).  If you cannot make that change, then I would strongly recommend that you wrap that field name in brackets:


What is it you are trying to update, something in Collects with something from your query [Get Old Cheque ID Last One]?  Generally a query will not be updateable if it includes any aggregates, and it looks like your query with the MaxID might do that.  

But you also made the comment:  "I tried to define the destination table fields" which implies that you are actually trying to append this data into another table, and there shouldn't be anything here preventing that.

Issa S.Author Commented:
Yes, you are right. I found that I used Grouping.

But how can you avoid using Grouping if you need to pick the last or the Max of FK and use it since it selects correctly and works well with Make, Append, Not Sure about CrossTab.

The easiest for me was to keep the current logic and use a buffer (Make) table that I delete on every entry. Then Make.

Thanks For your help.
Dale FyeOwner, Dev-Soln LLCCommented:
I generally have a local table in almost every one of my databases.  This table contains only two fields, a long integer field (TempID, indexed and unique) and a Yes/No field (IncludeThis).  I use this table for a variety of reasons, and this would be one of them.  Instead of simply creating the query that gets the MAX(ID) value for each customer or order, I delete all records from this temp table, run an append query to dump those MaxID values into that table, and because that table contains a unique TempID value, when you join it to your other table, it should be updateable.  

BTW, the [IncludeThis] field is immaterial to this discussion, but I use that to allow me to "select" items from this table and use that selection in a variety of ways.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Issa S.Author Commented:
Hi Dale,,,

Amazing.  That is also my way. In cases am not sure of something, I use a temp field with the ID key so don't miss the correct one. This is only spontaneous and for Updating immediately only since you can not rely on IDs changing with other operations like delete and add.

Issa S.Author Commented:
Very Comprehensive.
Thanks a Lot Dale.
Dale FyeOwner, Dev-Soln LLCCommented:
glad to help.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.