Results 1 to 5 of 5
  1. #1
    tmpgovrel is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    11

    Copying rows depending on number of fields full

    Hello,

    I am trying to figure out how to copy a row of information depending on if there are values in certain fields of that row.

    Below please find the tables of what I have and what I need:



    WHAT I CURRENTLY HAVE
    Mtg MOCName Status Poc PocNumber Time Location Participant1 Participant2 Participant3 Participant4
    1 Fred Conf Barb 4856145646 4:30 a Melissa Nick Patti Alicia
    2 Joe Conf Brian 5854689875 5:00 b Patti Ally Kerry Alicia
    3 Sam Conf Tim 5631463514 5:15 c Kerry Melissa Ally
    4 John Conf Tom 7588961225 4:45 d Nick


    WHAT I NEED
    Mtg MOCName Status Poc PocNumber Time Location Participant
    1 Fred Conf Barb 4856145646 4:30 a Melissa
    1 Fred Conf Barb 4856145646 4:30 a Nick
    1 Fred Conf Barb 4856145646 4:30 a Patti
    1 Fred Conf Barb 4856145646 4:30 a Alicia
    2 Joe Conf Brian 5854689875 5:00 b Patti
    2 Joe Conf Brian 5854689875 5:00 b Ally
    2 Joe Conf Brian 5854689875 5:00 b Kerry
    2 Joe Conf Brian 5854689875 5:00 b Alicia
    3 Sam Conf Tim 5631463514 5:15 c Kerry
    3 Sam Conf Tim 5631463514 5:15 c Melissa
    3 Sam Conf Tim 5631463514 5:15 c Ally
    4 John Conf Tom 7588961225 4:45 d Nick





    As you can see, depending on the amount of participants, the row with the meeting information will be copied.

    If someone can help me figure out how to make this work with a query (or if it isn't a query so I can post it in the correct forum) I would greatly appreciate it!

    --Ally

  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
    Look at UNION queries:

    SELECT Mtg, MOCName, Status, Poc, PocNumber, Time, Location, Participant1
    FROM TableName
    WHERE Participant1 Is Not Null
    UNION ALL
    SELECT Mtg, MOCName, Status, Poc, PocNumber, Time, Location, Participant2
    FROM TableName
    WHERE Participant2 Is Not Null
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    Also, I deleted your duplicate thread. Please don't post the same question multiple times.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    tmpgovrel is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jul 2013
    Posts
    11
    Thank you very much for yourr help. Sorry about posting twice - will know not to do that in the future.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    No biggie about posting twice, you don't know until somebody tells you. I take it the UNION query worked for you? It is basically normalizing the data.
    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. Replies: 3
    Last Post: 05-03-2013, 09:03 AM
  2. Copying selected rows from an access table.
    By Monu in forum Import/Export Data
    Replies: 1
    Last Post: 04-10-2013, 12:15 PM
  3. Replies: 5
    Last Post: 09-20-2012, 11:34 AM
  4. Replies: 0
    Last Post: 02-09-2012, 05:43 PM
  5. Copying into empty fields until...
    By cochi30 in forum Programming
    Replies: 8
    Last Post: 06-07-2009, 07:38 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