Selecting corresponding values from 2 related tables in Access database RRS feed

  • Question

  • I am brand new to the task I want to accomplish.  I have an Access database.  I have been able to scroll through a table and retrieve a row value (UserInit) using the SELECT statement in Word VBA.  Now I want to select the corresponding user's bar number from another table where AuthorID is the corresponding value.  So when I finish I will have a variable containing the UserInit and his corresponding BarNumber.
    Monday, February 20, 2012 3:43 PM


  • You'd use a SELECT statement like this:

    SELECT [Table1].UserInit, [Table2].BarNumber 
    FROM [Table1] INNER JOIN [Table2] ON 
    [Table1].AuthorID = [Table2].AuthorID

    where Table1 and Table2 are the names of the tables.

    Regards, Hans Vogelaar

    • Marked as answer by orlandp Monday, March 5, 2012 3:40 AM
    Monday, February 20, 2012 3:51 PM