Update all records at once

Safari

Member
Local time
Today, 14:54
Joined
Jun 14, 2021
Messages
95
Hi All

How can I update all records in table at once ?

I made update query but its only update one record only .

I want to update all at once


What's steps ?

Thanks
 
may I suggest a good book on how access works? that might help you along. or just SQL. that might work too. it seems that you probably have a WHERE clause in your statement if the query if updating only certain records.
 
An UPDATE query ALWAYS updates as many records in a table as are selected or implied or condoned by the combination of the named table (UPDATE tblname SET ...) and the WHERE clauses that filter the table's records according to field contents. If you only updated one record then you must have specified WHERE-clause filters that left you only one record. OR there was only one record in the table, though from your comments, that doesn't seem as likely.

To know exactly what you did / how you did that, could you show us your query? Open it in SQL view, highlight it, copy it, then start a new post in this thread and paste it in place.
 
what is the sql to your update query? Might be a where clause, might be a join causing only 1 record to be updated
 
hi all

i want to help me updating my query to update all records at once not only one record .. i attached my data base to check and update query name is // updateStoretransaction //

thanks
 

Attachments

you are updating records via [invoiceid] #.
the only value is 1.
The form shows value 2 as the default [invoiceid] , so nothing will update for 2.
 
Forms show value 2 when I need new record not current
 
hi all

i want to help me updating my query to update all records at once not only one record .. i attached my data base to check and update query name is // updateStoretransaction //

thanks
 

Attachments

If you want to update every record, don't use filter criteria.

Could run SQL action statement in VBA with CurrentDb.Execute
 
how can i do it ..
iam not good in vba
can you provide me
 
Why would you want to update all records with same data such as quantity?

I suggest you do some research on how to construct SQL statements in VBA.

Or try this criteria in your query: LIKE Nz([Forms]![invoicehead]![invoiceid], "*")
 
Last edited:
This is a repost of a similar question, which is still on going Here:-

 
This post has been reposted here:-

 
This is a repost of a similar question, which is still on going Here:-



yes .. but problem still not solved
 
check if this is what you want.
see the code on the subform's AfterUpdate event.
 

Attachments

In your query named updateStoretransaction, if you switch it to SQL view, you have the following:

Code:
WHERE (((StoreTransaction.invoiceid)=[Forms]![invoicehead]![invoiceid]));

This will force your update query to update only one record at a time. In the body of the query, you have elements like this:

Code:
UPDATE StoreTransaction SET StoreTransaction.itemstoreid = [Forms]![invoicehead]![invdetails Subform]![itemname], 
StoreTransaction.unit = [Forms]![invoicehead]![invdetails Subform]![unit], 
...

This implies that you have only one record at a time on the form where you are gathering data. I would say this single-record update behavior is absolutely correct behavior for the combination of the query that you have used and the data sources you are employing. From this particular form, you do NOT want to update all records at once. It will contain only one record's worth of data. There is no justification for making it store data in more than one record at a time.

You insist that the problem is not solved yet. Therefore, we are looking at one of two things happening here. Either

(a) you do not understand some project that you have inherited from someone else or

(b) your description of "not updating every record" doesn't mean to you what it sounds like it means to us, which would imply a language barrier issue.

I am not going to make assumptions either way, but I will categorically state that the problem AS YOU HAVE DESCRIBED IT is totally not possible to fix at any level. The code is not broken.
 
You opened another thread for this same question. Since you are new, I will simply note the fact that you now have an answer in another thread. However, for future reference, it is perfectly OK to continue a thread. Adding a new post to a thread has the same effect as adding a new thread. In either case, the post makes it to the top of the "New posts" list. You are new and this is a "site etiquette" issue so you can be forgiven.
 

Users who are viewing this thread

Back
Top Bottom