Updating Fields

  • Thread starter Thread starter greenbg via AccessMonster.com
  • Start date Start date
G

greenbg via AccessMonster.com

I have two field in a table and I would like to update one field with data
from another field; both field is in the same table. See the before and after
example below.

Before
After
Field-1 Field-2
Field-1 Field-2
1234
1234 1234
 
If you are trying to put the same data in two different fields, that is a
mistake!!

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
(e-mail address removed)
 
You want to update all the values in field2 with the value of field1 in ALL
fields in your table?

1. Create a new query in design view.
2. Add the table you want to update.
3. Change the query type to 'Update Query'.
4. Double click field2 (to add it to the query builder) this is the field to
be updated.
5. In the 'Update To' field of the query builder, type field1 this is the
field containing the data to be placed in field2.
6. Next, click the red (!) execute button on your toolbar.
Done!

Steve
 
I have two field in a table and I would like to update one field with data
from another field; both field is in the same table. See the before and after
example below.

Before
After
Field-1 Field-2
Field-1 Field-2
1234
1234 1234

Why?

Storing the same information redundantly in two fields sounds like a Very Bad
Idea. What happens if someone comes along and edits Field-2 to 4321? That's a
valid thing to do, but it would appear to make your data WRONG.

You can to this using a Form (tables have no usable events) but I really
question whether it should be done at all!

John W. Vinson [MVP]
 
John
I am using Field-2 is used as a history of Field-1.I just like to update
from Field-1 after a period of time.....
I have two field in a table and I would like to update one field with data
from another field; both field is in the same table. See the before and after
[quoted text clipped - 6 lines]
1234
1234 1234

Why?

Storing the same information redundantly in two fields sounds like a Very Bad
Idea. What happens if someone comes along and edits Field-2 to 4321? That's a
valid thing to do, but it would appear to make your data WRONG.

You can to this using a Form (tables have no usable events) but I really
question whether it should be done at all!

John W. Vinson [MVP]
 
John
I am using Field-2 is used as a history of Field-1.I just like to update
from Field-1 after a period of time.....

If you have a series of field values over time, a better design would be a
history table with one record (including a date)... but, you can certainly run
an Update query updating [Field2] to [Field1]. Do include the brackets,
otherwise it will update the field to the text string "Field1".

John W. Vinson [MVP]
 
Back
Top