Updating when adding a new field (1 Viewer)

Czeszyn

Registered User.
Local time
Today, 13:31
Joined
Oct 14, 2014
Messages
128
I had to add a new field to my form, which is part of my pull down menu. I got everything to work like it is suppose to. My question is, is there away that the past data that is already in the database would automatically up date that information that I had added. I can do it manually, but don't really want to go threw 26154 records. I know that this new field works now with the new data that I am entering, but it would be nice it would fill in the data from the past.

Thanks
Tony
 

Ranman256

Well-known member
Local time
Today, 16:31
Joined
Apr 9, 2015
Messages
4,337
That's what an update query is for.
Run one to alter all records.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 15:31
Joined
Feb 28, 2001
Messages
27,323
If you know the value you want to add, use an UPDATE query that tests for the records being Null.

Code:
UPDATE MyTable SET MyNewField = MyNewValue WHERE ISNULL( MyNewField ) = TRUE ;

This would work (possibly with punctuation changes if the field is of type Short Text) if you have a "default" value for the new field.

If the field depends something else, it gets more complex, but if you can start with essentially a constant value for the old cases, the above should work.
 

Czeszyn

Registered User.
Local time
Today, 13:31
Joined
Oct 14, 2014
Messages
128
Thank you everyone every one for your help. The update query did work. Thank you again. It feels good to know that there are smart people who know MS ACCESS so well, otherwise I would be lost. LOL.

Tony
 

Users who are viewing this thread

Top Bottom