Loop Question

R

Ryan

Hello,
I have never used a loop before, but it looks like the best way to copy from
one text field to another in a large database. I have about 12000 records
and I need to copy the information from one field to another through all the
records in a query.

not sure where to start? any help would be appreciated. I guess i need to
write code to open the query, copy the info in the first record and loop
through each record until it is done.

Thanks in advanced
Ryan
 
J

John W. Vinson

Hello,
I have never used a loop before, but it looks like the best way to copy from
one text field to another in a large database. I have about 12000 records
and I need to copy the information from one field to another through all the
records in a query.

not sure where to start? any help would be appreciated. I guess i need to
write code to open the query, copy the info in the first record and loop
through each record until it is done.

No loop, no code, no steps needed. A very simple UPDATE query will do this:

UPDATE mytable
SET [secondfield] = [firstfield];

Back up your database first of course; then In the query design grid create a
query based on the table; change it to an Update query using the query type
tool on the toolbar; and type the name of the field containing the data you
want to copy on the Update To line under the field to be updated. It's
critical to enclose the fieldname in [square brackets] or it will update the
data to the name of the field!

I do have to wonder why you are storing the same data redundantly in two
fields, however! What will you be doing with this data?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top