Results 1 to 5 of 5
  1. #1
    PasJes is offline Novice
    Windows 10 Office 365
    Join Date
    Aug 2023
    Posts
    6

    Update field in one table with value from field in another...not linked

    I have a table that contains makes and models of cars. Call it table 1.




    I have another table that contains a single field that has the year, make, model and a bunch of other stuff in a single field. Call that table 2.


    What I'd like to be able to do is to loop through table 1 and see if the model is contained in any of the records in table 2.


    So say for example, the first record in table 1 is make = Volkswagen. Model = Golf.


    I want to run through every record in table 2...find where a part of the single field matches "Golf" and if so, add that value to a new field called model (which I will create).


    Does that make sense? Probably haven't explained very well.


  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2019
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    I would recommend that you normalize your db first. See e.g. https://learn.microsoft.com/en-us/of...on-description
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    PasJes is offline Novice
    Windows 10 Office 365
    Join Date
    Aug 2023
    Posts
    6
    Quote Originally Posted by Bob Fitz View Post
    I would recommend that you normalize your db first. See e.g. https://learn.microsoft.com/en-us/of...on-description
    I can't really. The data in table 2 is provided to me every day from an external source.

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2019
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Quote Originally Posted by PasJes View Post
    I can't really. The data in table 2 is provided to me every day from an external source.
    In that case I would create a db with normalized tables and then concentrate my efforts on manipulating that daily data into the correct fields, in the correct tables.
    A poorly designed db will cause you no end of headaches going forward.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    Join Date
    Apr 2017
    Posts
    1,687
    There are different models of e.g. VW Golf available (+ some of those models have different names in different countries). VW Golf GTE, VW Golf GTI, VW Golf GTD, VW Golf R, VW Golf TSI, VW e-Golf, etc. So when you have only "Golf' to search for, how do you decide, which one? Or will be VW Golf family be enough for you?

    Generally for getting such info from field, you have to search for a string in field. When the position of this string is >0, the record does match, when =0 then it doesn't match. There will be problem, when the string you search for is not uniform (like VW Golf GTE or Volkswagen Golf GTE) - when this is the case, the search will be more complex (you have to search for all possible combinations), or even impossible (e.g. the producer is missing, and the search will match for several producers).

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 0
    Last Post: 09-03-2014, 02:37 PM
  2. Replies: 3
    Last Post: 02-17-2014, 12:56 AM
  3. Replies: 5
    Last Post: 11-01-2012, 09:26 AM
  4. Replies: 21
    Last Post: 10-29-2012, 02:01 PM
  5. Replies: 1
    Last Post: 08-31-2011, 04:03 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums