Results 1 to 3 of 3
  1. #1
    stephenaa5 is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Oct 2009
    Posts
    72

    concatenate

    Hi. Need to concatenate the data in a given field of a continuous form, IF another field of the same record (which is a Y/N) is equal to Y. That data will be put in a holding control "TITLEBLOCK" used on subsequent reports, to state in the header what data is included.



    So, the form is "Selector". The Y/N is "include" and the field is "building". Here's a quick and dirty:

    Include building
    Y site 1
    Y site 2
    N site 3

    TITLEBLOCK would be "site 1, site 2"

    Any help is appreciated. My VB knowledge is pretty light, particularly where looping is concerned. I'm thinking that's what's needed here.

    Thanks,

    SC

  2. #2
    TheShabz is offline Court Jester
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    1,368
    i dont think you're looking to concatenate persay. Are you trying to get a table that looks like:
    Include building
    Y site 1
    Y site 2
    N site 3

    into one tha tlooks like
    Include building
    Y site 1 site 2
    N site 3

    if so, look up the crosstab query. that should help you out. no vba necessary (unless its within a larger framework, then just save it as a sql string and run it).

  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,521
    I suspect you want something along these lines:

    Return a concatenated list of sub-record values

    http://allenbrowne.com/func-concat.html

    customized to restrict records to the Y and whatever criteria restricts the subform.
    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. How to Concatenate String Criteria
    By ColPat in forum Programming
    Replies: 2
    Last Post: 06-26-2010, 08:48 PM
  2. Replies: 3
    Last Post: 10-16-2009, 09:27 AM
  3. Concatenate Formula
    By Shingo in forum Programming
    Replies: 1
    Last Post: 07-25-2009, 09:14 AM
  4. Need Code to Concatenate All Records
    By menntu in forum Programming
    Replies: 4
    Last Post: 06-05-2009, 09:43 AM
  5. concatenate string using loop
    By nengster in forum Programming
    Replies: 0
    Last Post: 02-23-2009, 08:05 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