Results 1 to 3 of 3
  1. #1
    PJ_d_DJ is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2011
    Posts
    2

    Expression builder

    Hello,

    I am currently trying to build an expression for a problem for my uni course and was wondering if anyone would like to try to help me.

    I am complete newb when it comes to MS Access and feel rather frustrated not being able to solve it.

    I've had a look on You Tube but was unable to find a solution for the issue.

    The problem is building an expression which will collate all names of authors for (imaginary) papers for export into Word document to be "a list of references".



    The list should have 4 papers with a number of authors (i.e. the 1st and 3rd paper have 3 authors each, paper number 2 has 1 author and paper number 4 has 2 authors).

    Now, I would like to make a query "make author list" which will have fields paper id and paper title (taken from qry Assemble paper info which I have prepared that contains the data) and an expression to put all the authors in order per paper.


    So, I am having a massive problem in writting the expression, i.e. using operators that will either put a comma or a space behind the author.

    Does anyone know how to use operators to have this to work:

    What I got at the moment (and it isnt working) is:

    author list: [qryAssemblePaperInfor]![qrySeniorAuthor]![Author 1] & IIf( [qryAssemblePaperInfor]![qryGetSecondAuthor]![Author 1]=",",',' & [qryAssemblePaperInfor]![qryGetSecondAuthor]![Author 1] ) & IIf( [qryAssemblePaperInfor]![qryGetThirdAuthor]![Author 1]=",",',' & [qryAssemblePaperInfor]![qryGetThirdAuthor]![Author 1] )

    The course notes have figure which I tried to follow... but not really understanding what the operators actually do I am not really helping myself at all.

    Can anyone help?

    Thank you.

  2. #2
    NoellaG's Avatar
    NoellaG is offline VIP
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,035
    Hi,

    the & symbol is the concatenation operator; the iif function has the following syntax:
    Iif(Condition, value if true, value if false). You can find some explanation about operators and functions in the Help files.The expression you type has several nested Iif functions.

    But without knowing the underlying table structure, and query design, it's difficult to help.

    Success
    NG

  3. #3
    PJ_d_DJ is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2011
    Posts
    2
    Thank you very much.

    The underlaying structure is a query which assembles the relevant authors per each paper.

    The Iif is supposed to assemble these in order of author rank.

    As every paper has different order of authors the Iif is supposed to either put a comma or the full stop behind the author's name, depending whether there are any author names coming behind.

    In any case thank you for your reply.

    Pj.

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

Similar Threads

  1. basic expression builder issue
    By nagsha in forum Access
    Replies: 1
    Last Post: 09-06-2010, 02:29 AM
  2. Expression builder error, circular reference
    By cowboy in forum Programming
    Replies: 3
    Last Post: 07-15-2010, 12:55 PM
  3. Expression Builder: If DateValue
    By Rip22 in forum Queries
    Replies: 4
    Last Post: 03-09-2010, 10:51 AM
  4. Code Builder
    By nkenney in forum Forms
    Replies: 3
    Last Post: 11-04-2009, 10:58 AM
  5. Expression Builder
    By mistaken_myst in forum Access
    Replies: 2
    Last Post: 05-07-2008, 01:30 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