Results 1 to 10 of 10
  1. #1
    mainerain is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Location
    Maine, USA
    Posts
    146

    finding table name


    I have a Serial Number and I want to determine which Table it resides in. Once I know which table I will open the corresponding Form to reveal the details about that associated device Serial Number. Sorry if there isn't enough info. I don't always know how to ask question to get my intended answer. I'm a Greenhorn.

  2. #2
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    It sounds like you may have a data structure problem. In general, you shouldn't have multiple tables holding the same type of information (typically there would be one table for holding all like information).
    Can you describe the table structure, and why you have mutliple tables that you need to search across for a single item?

  3. #3
    mainerain is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Location
    Maine, USA
    Posts
    146
    I have many different device types and models. I have included a devices serial number in the appropriate table.

  4. #4
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Are all the tables structured similarly?
    If so, then you should only have one table. You would just have different fields for your device types and models, so you can easily filter on them.

    That is why a good database design is so important. If you find yourself having to do odd things (or things that there doesn't seem to be a good way to do), that is often a sign that there may be a design issue.

  5. #5
    mainerain is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Location
    Maine, USA
    Posts
    146
    Often times the items are completely not alike, thus so many different tables to accommodate.

  6. #6
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Then a Union Query might be your best bet here.

    Let's say that you have three tables, that are totally different structures, but all have a SerialNumber field.
    Then, you could create a Union Query like this here to return all Serial Numbers and Table names to a single Query that you could then use to locate where the record exists, i.e.
    Code:
    SELECT SerialNumber, "Table1" as TableName
    FROM Table1
    UNION
    SELECT SerialNumber, "Table2" as TableName
    FROM Table2;
    UNION
    SELECT SerialNumber, "Table3" as TableName
    FROM Table3;
    For more on Union Queries, see these links here:
    https://support.office.com/en-us/art...0-ad0a75541c6e
    https://www.datanumen.com/blogs/crea...lts-ms-access/

  7. #7
    mainerain is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2018
    Location
    Maine, USA
    Posts
    146
    That sounds promising. I'm running out of time. Will try later. Thanks so much.

  8. #8
    JoeM is offline VIP
    Windows 7 32bit Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    You are welcome.

  9. #9
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    mainerain,

    If you don't have a solution, it may be helpful if you gave some details of your table designs, or a graphic of your tables and relationships, and/or some sample data.
    Many problems/issues with database originate with improper design of basic table structures, as JoeM mentioned.


    I posted a sample- modified universal search - a few years back that may be useful.
    Good luck.

  10. #10
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,793
    Often times the items are completely not alike, thus so many different tables to accommodate.
    Not convinced that there isn't a problem. Surely there must be a parent entity involved? And to open the "corresponding form" based on what table a serial number is in just adds to that suspicion.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

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

Similar Threads

  1. Replies: 1
    Last Post: 05-22-2018, 07:47 AM
  2. Finding predecessors within a table
    By Karyn in forum Access
    Replies: 1
    Last Post: 03-11-2015, 05:51 AM
  3. Finding Customers (table-1) without Tasks (table-2)
    By fredfortsonsr in forum Queries
    Replies: 3
    Last Post: 02-18-2015, 07:31 PM
  4. Finding Table Aliases
    By hfile in forum Access
    Replies: 2
    Last Post: 12-26-2011, 02:38 PM
  5. Replies: 2
    Last Post: 06-20-2010, 06:54 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