Help to change data in a table

  • Thread starter Thread starter Mattias
  • Start date Start date
M

Mattias

Hi

I have a table with data I would like change with help from code running a
loop throw all the records and change.
There are about 3.000 records in the table.

The data I would like to change is in txt field called Field1.
I would like to create a new txt field Field2 (I create this manually in
design view), then I would like the code to delete some data and move some
data from Field1 to the new Field2.

All the records in Field1 have the same data structure: 1text, 2text
I would like to keep 1text in Field1 delete , and move the 2text (without
space in front of it) to the new Field2

Is it poosible to do this by code?

Thank you in advance..

Mattias
 
Mattias said:
Hi

I have a table with data I would like change with help from code running a
loop throw all the records and change.
There are about 3.000 records in the table.

The data I would like to change is in txt field called Field1.
I would like to create a new txt field Field2 (I create this manually in
design view), then I would like the code to delete some data and move some
data from Field1 to the new Field2.

All the records in Field1 have the same data structure: 1text, 2text
I would like to keep 1text in Field1 delete , and move the 2text (without
space in front of it) to the new Field2

Is it poosible to do this by code?

Why don't you just use an update query?

(untested)

UPDATE YourTableName
SET Field2 = Mid(Field1, InStr(1, Field1," ")+1),
Field1 = Left(Field1, InStr(1, Field1, ",")-1)
 
Back
Top