Use a single row in another table for a query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • djdaveg
    New Member
    • Jan 2010
    • 9

    Use a single row in another table for a query

    I am wondering if it possible to refer to a row of data in access for a query, if I want to find a row by ID then use the next field in that row for a query without access using whole column, is this possible.
  • Echidna
    New Member
    • Jan 2008
    • 53

    #2
    Hi Dave,

    in the query designer.
    Open the tables you wish to display data from.

    if no relationship exists between the two tables, you can create one by dragging the ID column from Table one over to the corresponding column in table two (establishing a relationship),

    The columns selected from table two will display the data where the ID is equal to Table One.

    hope this helps, and is not too vague...

    Cheers

    Leon

    Comment

    • djdaveg
      New Member
      • Jan 2010
      • 9

      #3
      Hi, thanks for your reply, however the ID numbers in the two tabels don't match, I have a database in one and a few towns and postcodes in the other, I need to reference a town and then its postcode without access using the whole column in the table and just using the one that the first part of the query has matched

      Comment

      • Echidna
        New Member
        • Jan 2008
        • 53

        #4
        does the main table have any reference to the data held within the second table?

        if so, you can set the query column to a dlookup to display the data within the desired column

        Cheers

        Leon

        Comment

        • djdaveg
          New Member
          • Jan 2010
          • 9

          #5
          not that you can accurately match record by record, for example there is a column of postcode prefixes i.e. BB and town e.g. Blackburn

          Comment

          • Echidna
            New Member
            • Jan 2008
            • 53

            #6
            Hi,

            Only thing i can think of is adding a column to the primary table which would reference the ID of the secondary table, then populate the primary table's value from a function call like :



            Hope this helps.

            Cheers

            Leon

            Comment

            • djdaveg
              New Member
              • Jan 2010
              • 9

              #7
              Hi Leon,
              Thanks for your help, I will give this a go

              Comment

              • Echidna
                New Member
                • Jan 2008
                • 53

                #8
                Glad I could help

                Cheers

                Leon

                Comment

                Working...