Results 1 to 10 of 10
  1. #1
    jlgray0127 is offline Competent Performer
    Windows 2K Access 2000
    Join Date
    Oct 2011
    Location
    Central Illinois
    Posts
    187

    Advanced Queries and Macros - Looking for a shortcut


    I have another question!
    In my database, I have a table that has 120 unique fields that represent part numbers in a rack. I need to take this data and put it into another table where I can have Ea of the unique fields on a unique record.

    I am attaching a word doc with samples of the Data Entry table, and the table I am creating with the Data Conversion Table.

    The only thing I know to do, is to look at one record, and creat 120 append queries that add Field A1 to the table, then append query 2 to add A2 to the Table, ect... I hope the spreadsheet explains what I am trying to do.

    I appreciate any help I can get. Even if it's "your crazy. Seek medical treatment!" lol

    Thank you!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    A UNION query can achieve that result for you.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    jlgray0127 is offline Competent Performer
    Windows 2K Access 2000
    Join Date
    Oct 2011
    Location
    Central Illinois
    Posts
    187
    Quote Originally Posted by pbaldy View Post
    A UNION query can achieve that result for you.
    Can you show me a sample of what you mean from the file I had attached? I am not efficient with Union Queries and am unsure how it would work with one table in the manner I demonstrated. Thank you very much for your help!

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    SELECT LogisticsPlanningEngineer, A1 AS Part, "A1" AS Quant
    FROM TableName
    UNION ALL
    SELECT LogisticsPlanningEngineer, A2 AS Part, "A2" AS Quant
    FROM TableName
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    jlgray0127 is offline Competent Performer
    Windows 2K Access 2000
    Join Date
    Oct 2011
    Location
    Central Illinois
    Posts
    187
    I did this, but there are 2 issues. I am doing it in 4 seperate queries because there is a limit to the Union Query. I got an error stating Query is to complex, so I had to break it down into different stages. Below is a sample of the SQL Statement.
    The first one works, but the 3 that I did after, do not. The only thing that is different, are the fields. I went through all 3 of them and compared to the first one.
    Any idea what is going on? All 4 queries are like this, A1 through A50, then A51 through A100, A101 through A150, and A 151 through A200....

    SELECT [Logistics Planning Engineer],[Date and Time], [Old Location], [Location], [ILC Location], [PSA], A1 AS Part, "A1" AS Quant
    FROM [Locations and Parts Racks]
    UNION ALL
    SELECT [Logistics Planning Engineer],[Date and Time], [Old Location], [Location], [ILC Location], [PSA], A2 AS Part, "A2" AS Quant
    FROM [Locations and Parts Racks]
    UNION ALL
    SELECT [Logistics Planning Engineer],[Date and Time], [Old Location], [Location], [ILC Location], [PSA], A3 AS Part, "A3" AS Quant
    FROM [Locations and Parts Racks]
    UNION ALL
    SELECT [Logistics Planning Engineer],[Date and Time], [Old Location], [Location], [ILC Location], [PSA], A4 AS Part, "A4" AS Quant
    FROM [Locations and Parts Racks]

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    You're saying the 1-50 query works, and the others don't? I can't see why offhand. Can you post a sample db or something?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    jlgray0127 is offline Competent Performer
    Windows 2K Access 2000
    Join Date
    Oct 2011
    Location
    Central Illinois
    Posts
    187
    Sure... please see attached... I am getting an error in the sample, which I did not get yesterday, in the original DBA.

    Syntax error - incomplete clause

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    Each of the other 3 has a line with a period in it:

    FROM [Locations and Parts Racks].

    That period is causing the error. It's down near the bottom, like 144.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    jlgray0127 is offline Competent Performer
    Windows 2K Access 2000
    Join Date
    Oct 2011
    Location
    Central Illinois
    Posts
    187
    Thank you, Thank you, THANK YOU! I did not see that and was ready to start deleting or just throw the whole pc through the window! Thank you!

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    LOL! Sometimes that's what they deserve; to be thrown out the window. Glad we got it sorted out.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Access shortcut?
    By darklite in forum Access
    Replies: 4
    Last Post: 04-11-2011, 10:12 AM
  2. Shortcut & .mdw
    By tbassngal in forum Security
    Replies: 3
    Last Post: 12-06-2010, 02:38 PM
  3. Remove Reports Shortcut
    By Desstro in forum Reports
    Replies: 1
    Last Post: 11-25-2010, 12:50 AM
  4. Front End vs. Shortcut
    By eww in forum Access
    Replies: 3
    Last Post: 11-12-2010, 03:02 PM
  5. custom shortcut menu help!
    By ninachopper in forum Access
    Replies: 5
    Last Post: 09-05-2010, 06:27 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