Copy table data from one field to another... (1 Viewer)

derekbeck

Registered User.
Local time
Yesterday, 19:58
Joined
Mar 1, 2012
Messages
16
I have attached an example database.

I have a column in the table "tasks" that is text, called "OptionsOld". I have recreated that field as "Options" as a new lookup table, so the datatype is necessarily now a number (connected to the id primary key of the "options" table).

In Access 2007, how can I generate a query or whatever to get all of the data from OptionsOld into Options? The former is text, and the latter is a lookup table and so a number, thus I need some conditional statement I think. I know nothing of VBA in Access, so I'm hoping the answer is simple and doesn't require VBA.

Thanks,
Derek
 

Attachments

  • DatabaseFill.accdb
    648 KB · Views: 283

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 19:58
Joined
Aug 30, 2003
Messages
36,129
How about

UPDATE menus INNER JOIN tasks ON menus.Selector=tasks.OptoinsOld SET tasks.Options = [menus].[id]
 

derekbeck

Registered User.
Local time
Yesterday, 19:58
Joined
Mar 1, 2012
Messages
16
That worked perfectly too! Thanks. I hate to impose on your genorosity, but perhaps you might be able to answer with ease my 3rd and final question? It is at

access-programmers.co.uk/forums/showthread.php?p=1136568#post1136568

Thanks you again!
 

Users who are viewing this thread

Top Bottom