Results 1 to 2 of 2
  1. #1
    Murraylr is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2015
    Posts
    1

    Linking two tables via with a wildcard

    Hi all,

    I'm very new to MS Access & I am totally stuck. I have searched the web & youtube but I can't find something to match what I'm trying to do. Saying that my poor terminology is probably not making life easy.

    Anyway, I have two data tables. One being the main data source & the other is just a lookup table. So I want to add an extra column to the source data from the lookup table, however I can't do a straight link because the lookup references are different. The lookup table has a 'begins with' col, so ideally I'm looking to find a way to join all data that begins with col1 of the source data against col1 of the lookup & add col2 of the lookup into the source data. For example:=

    Source Data


    Col1
    ABCDEF,
    ABCDD1,

    Lookup Data
    Col1, Col2
    ABC , Test 1
    ABCDD , Test 2

    OUTPUT OF SOURCE
    Col1, Col2
    ABCDEF, Test 1
    ABCDD1, Test 2



    I'm really sorry if this is an easy ask, but I just can work out how to do it.

    Cheers
    Lee

  2. #2
    Rawb is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    For you to directly link the Tables in the manner you want, your "begins with" field will need to be one of 2 things:
    1. an exact match for the data in your other table (no wildcards), or
    2. always exactly the same length


    You have a few more options if the data will never change in either of the tables once it's been inserted, but if any of the data can be changed/updated the best you'll probably be able to do is come up with a VBA function that does the matching and writes the data to a temporary table.

    NOTE: With item 2 above, you still can't create a DIRECT link between the two tables, but you can at least create a Lookup Query to get the data you want instead of having to write a VBA function for it.

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

Similar Threads

  1. Linking Tables
    By MaineLady in forum Access
    Replies: 1
    Last Post: 09-08-2014, 08:54 AM
  2. Replies: 9
    Last Post: 12-05-2013, 11:48 AM
  3. Linking Tables
    By exnuke1972 in forum Access
    Replies: 4
    Last Post: 12-14-2011, 02:50 PM
  4. Deleting Tables With Wildcard?
    By orcinus in forum Programming
    Replies: 2
    Last Post: 06-20-2011, 10:48 AM
  5. Replies: 0
    Last Post: 03-04-2011, 10:28 AM

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