View Full Version : Updating between fields of different data types


kupe
06-21-2005, 01:17 AM
WorkID is a look-up field, so its Data Type is Number.
In the same table, DailyGrind is a field with the Data Type of text.

I would like to update WorkID with the jobs in DailyGrind.

Surely there must be a way to do it, gurus?

Mile-O
06-21-2005, 09:00 AM
Why would you want to replace numbers with text?

Pat Hartman
06-21-2005, 12:08 PM
If what you really want is to display text values rather than the numeric foreign key values, use a query that joins the main table to the lookup table and select the text field. Use that query as the RecordSource for reports. If you use the query as the RecordSource for forms, be sure to LOCK the text field so that it is not accidentally changed.

kupe
06-22-2005, 02:37 AM
Thanks, SJ, thanks Pat.

I've been changing a one-table db over to a relational db.

The problem was caused by look-up tables. I wanted to put info from the old text field into the new lookup field.

However, I have been advised that lookup tables are a very poor idea, and having been shown several articles on this theme, promptly removed them. A lot of problems ended with that.

Another problems arises, but I will post that separately. All the best

Pat Hartman
06-22-2005, 01:12 PM
I have been advised that lookup tables are a very poor idea,. I don't know who your advisor is but I beg to differ. It is NOT lookup tables that are a poor idea, it is embedding them in your table description which is quite a different thing. Lookup tables are good. They allow you to enforce RI and they provide the source rows for your combo and listbox RowSources. I use them in EVERY database I make to prevent data entry errors.