• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 285
  • Last Modified:

How update part of a text string in a table based on a change to a text string in another table?

I hope I can explain this one well enough for someone to understand.

I have two tables.  Each table has a text field.  For example, table #1, named tblImages has a text field and in one record that text field may say "Blue Ribbon".

Then there may be one or more records in the 2nd table named tblProducts".  and in this field for example one record may say "Blue Ribbon, 2" wide, 48" long".  And another record may say "Blue Ribbon, 3" wide, 42" long".

If the user has changed the text in table #1 to, for example, "Old Blue Ribbon", then I want the records in table #2 to read...  "Old Blue Ribbon, 2" wide, 48" long" and the other record to read "OldBlue Ribbon, 3" wide, 42" long".

Is there any way to do this?









"Blue Ribbon, 2" wide, 48" long".
0
SteveL13
Asked:
SteveL13
1 Solution
 
c1nmoCommented:
You could use two tables and present the result in a query, see attached screenshot.  When  mainvalue is updated in tablea, the query automatically reflects the change.
joined.png
0
 
regmigrantCommented:
if the text part of the name is transferable in such a direct way you would be better re-designing your tables so that one contains the text description and the other is related using an ID. In your forms you would then pick up the appropriate text from the table based on the foreign key. In this was you only store the text once and its always automatically updated.

Doing it the way you describe is leaving yourself open to a world of pain and corrupt data - for example: what if you have Blue Ribbon, Red White and Blue Ribbon, striped Blue Ribbon etc etc. - changing Blue Ribbon in any of those to Old Ribbon would presumably be wrong
0
 
aikimarkCommented:
if the text ("Blue Ribbon, 2" wide, 48" long") was a result of a query, then you should be able to construct the text to use a name field the user might change and an item dimension field that the user can not change.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
SteveL13Author Commented:
To c1nmo:

I'm not sure I understand.  Are tablea and table b temporary tables?  Or?  And if so how did you create them in the query designer?
0
 
c1nmoCommented:
No, just standard tables created in the usual way then added to query designer so they could be joined.
0
 
SteveL13Author Commented:
You are correct.  This whole idea is too risky.
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now