Update Field in Multiple Specific Records (1 Viewer)

xyba

Registered User.
Local time
Today, 23:40
Joined
Jan 28, 2016
Messages
189
Hi

In my table I frequently need to add a date in a date field for multiple specific records. It will always be the same date (usually current day) for all the selected records. As there can be 200+ needing to be updated I don't want to have to visit each record manually.

How would I go about doing this?

Table = tblData
Date field = DestroyDate
Record identifying field = OldID
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 07:40
Joined
May 7, 2009
Messages
19,169
use an Update Query to update your table.
 

xyba

Registered User.
Local time
Today, 23:40
Joined
Jan 28, 2016
Messages
189
use an Update Query to update your table.

Thanks arnel. How, though, do I select the specific records by using an update query? Or is that part of the query process? I've never used an Update query before so apologies if that's a stupid question.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 16:40
Joined
Oct 29, 2018
Messages
21,358
Thanks arnel. How, though, do I select the specific records by using an update query? Or is that part of the query process? I've never used an Update query before so apologies if that's a stupid question.
Hi. To be safe, you can create a SELECT query first to verify the query is selecting the correct records you want to update. Once you get it right, you can switch the SELECT query into an UPDATE query.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 07:40
Joined
May 7, 2009
Messages
19,169
goto Create New Query in the ribbon.
select your table from the list.
close the list.
double click from the table the field you want to update.
on the ribbon, select Update query.
on the bottom window, put the value you want to put in "Update To:"
don't update the identifying field (oldID), by unchecking it.
add criteria to oldID
Code:
IN (1,2,3,4,8)
the numbers there are the oldID records you want to be included on the update.
 

xyba

Registered User.
Local time
Today, 23:40
Joined
Jan 28, 2016
Messages
189
goto Create New Query in the ribbon.
select your table from the list.
close the list.
double click from the table the field you want to update.
on the ribbon, select Update query.
on the bottom window, put the value you want to put in "Update To:"
don't update the identifying field (oldID), by unchecking it.
add criteria to oldID
Code:
IN (1,2,3,4,8)
the numbers there are the oldID records you want to be included on the update.

Thanks, I'm working on it. I'm just having an issue with criteria which I'm trying to resolve.

At least I know where to start now.

Thank you
 

xyba

Registered User.
Local time
Today, 23:40
Joined
Jan 28, 2016
Messages
189
Update: Now resolved my criteria issues and have managed to successfully update my records using the above method from arnel and DBGuy.

Thank you.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 16:40
Joined
Oct 29, 2018
Messages
21,358
Update: Now resolved my criteria issues and have managed to successfully update my records using the above method from arnel and DBGuy.

Thank you.
Hi. Congratulations! Glad to hear you got it sorted out. Arnel and I were glad we could assist. Good luck with your project.
 

Users who are viewing this thread

Top Bottom