Results 1 to 9 of 9
  1. #1
    jbailey4545 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    14

    Query Error 3075 Syntax Error


    having an issue I can't get past, below is the code:

    Expr1: ConcatRelated("[PUB_fm_type].[client_id]","[PUB_fm_type]",[PUB_client].[first_name] & """")

    I receive the error

    Error 3075: Syntax error in string in query expression 'Brian'".

    [PUB_client].[first_name] is test

  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,521
    Presuming that's the function from Allen Browne's site, check how to call it again. You've got the syntax wrong.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    Tell us about tables PUB_fm_type and PUB_client.
    Ans also what you expect in the output. We only know what you tell us, and so far we don't have much.
    You are missing leading quote for third parameter, but there may be more.

  4. #4
    jbailey4545 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    14
    Below is the full code:

    SELECT PUB_fm_type.client_id, ConcatRelated("[PUB_fm_type].[client_id]","[PUB_fm_type]",[PUB_client].[first_name] & """") AS Expr1, PUB_fm_type.type
    FROM (PUB_family INNER JOIN PUB_client ON PUB_family.person_id = PUB_client.client_id) INNER JOIN PUB_fm_type ON (PUB_family.person_id = PUB_fm_type.person_id) AND (PUB_family.client_id = PUB_fm_type.client_id)
    GROUP BY PUB_fm_type.client_id, ConcatRelated("[PUB_fm_type].[client_id]","[PUB_fm_type]",[PUB_client].[first_name] & """"), PUB_fm_type.type
    HAVING (((PUB_fm_type.type)=8));

    does that help?

    There ae multiple lines for PUB_fm_type.client_id that will have a different person_id

    Trying to display one line for each pub_fm_type.client id with all the different person_id names

  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,521
    From Allen's site for the third argument:

    If the foreign key field is Text (not Number), include quote marks as delimiters, e.g.:
    "[ForeignKeyFieldName] = """ & [PrimaryKeyFieldName] & """"

    yours

    [PUB_client].[first_name] & """"
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    jbailey4545 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    14
    Sorry but I am lost. I changed to

    ConcatRelated("[client_id]","[PUB_fm_type]","[PUB_client].[first_name] """ & [PUB_client].[last_name] & """")

    Still receive error and it displays [PUB_client].[first_name] as text instead of pulling data.

    Error 3075: Syntax error (missing operator) in query expression '[PUB_client].[first_name] "Dunn"'

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You left out the =. You also seem to be using 2 different fields.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    jbailey4545 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jun 2012
    Posts
    14
    I have tried with and without. Here is what i have to make it simple.

    I have table pub_fm_type with client_id, person_id, and type

    Client_id person_id type
    555 666 8
    555 777 9
    555 888 8

    need it to pull
    Client_id person_id type
    555 666, 888 8

  9. #9
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    I built a table with the 3 example records and some different ones for testing.

    SELECT PUB_fm_type.client_id, ConcatRelated("[person_id]", "[PUB_fm_type]", "Type='8' AND Client_id='" & [Client_id] & "'") AS Expr1, PUB_fm_type.type
    FROM PUB_fm_type
    GROUP BY PUB_fm_type.client_id, PUB_fm_type.type
    HAVING (((PUB_fm_type.type)='8'));
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 3
    Last Post: 03-05-2013, 11:17 AM
  2. Replies: 4
    Last Post: 07-25-2012, 04:01 AM
  3. Replies: 6
    Last Post: 05-30-2012, 12:32 PM
  4. Replies: 5
    Last Post: 03-27-2012, 01:40 PM
  5. Syntax error missing operator(3075)
    By parisienne in forum Programming
    Replies: 1
    Last Post: 04-07-2011, 02:29 PM

Tags for this Thread

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