Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2005
    Location
    North Carolina, USA
    Posts
    11

    Unanswered: Floating Report Fields

    I have a report which outputs (among other things) a field called proj_num (for the project number) and proj_desc (for the title of the project). Right now, I have those as two separate text fields. But I have to leave quite a bit of space to allow for varying lengths of project numbers. So my report might look like:

    PN 1____________Admin
    PN 1.45.33954 __Timekeeping


    (Underscores added for formatting placeholders)

    Or something like that. What I'd like to do is append the proj_desc field to the proj_num field to create:

    PN 1 - Admin
    PN 1.45.33954 - Timekeeping


    I thought I could use this as the control source for the field:

    =[proj_num] & " - " & [proj_desc]

    But that didn't work, it returned "#ERROR" on the report.

    I also tried:

    =[proj_num] + " - " + [proj_desc], but it returned the same error.

    Any ideas? Can a text field have multiple control sources? Thanks in advance.

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Yep - that should work fine. Keep playing with it
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Sep 2005
    Location
    North Carolina, USA
    Posts
    11
    Quote Originally Posted by pootle flump
    Yep - that should work fine. Keep playing with it
    Which? The first, with the ampersands? That's how other VBA stuff works that I've done (using the apersands to append fields), so I figured it'd work here too.

    It doesn't give any runtime error message. The field just contains the text "#ERROR" on my report. Any ideas what that means? When I generate the report, I'm using data that contains valid information for those two fields (proj_num and proj_desc).

  4. #4
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    The former.

    Actually - just thought - I've been stung by an Access "feature" before now that causes this.

    Do you have any Controls called proj_num or proj_desc? If so, change the name (say txtProj_Num). Also (here's the killer) check that the forumla you enter (=[proj_num] & " - " & [proj_desc]) has not been "helpfully" changed by access too.

    HTH
    Testimonial:
    pootle flump
    ur codings are working excelent.

  5. #5
    Join Date
    Sep 2005
    Location
    North Carolina, USA
    Posts
    11
    Are you talking about controls on the report? Like is my actual text field on the report ALSO called proj_desc? That's a great question, and I'm not sure, but I will check.

    It appears that Access DOES parse my entered expression, but it's appearing to do only good (like putting proj_desc in [ ] for me when I didn't, etc). It doesn't appear to be maligning the expression.

    But I will check on the first point. Without having the DB in front of me at the moment, I'll guess that I actually DO have a control named the same as the actual table field...a no-no I'm sure.

    Thanks again!

  6. #6
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    What's the name of the textbox you're using to concatenate your field values? It can't be the same as any of the fields you're evaluating or it will get pissy about a circular reference and display a #NAME error.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  7. #7
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,424
    Provided Answers: 8
    make shour the feild that hold the

    =[proj_num] & " - " & [proj_desc]

    is NOT CALL proj_num or proj_desc
    hope this help

    See clear as mud


    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB based on my own environment: vb6 sp5
    ASP based on my own environment: 5.6
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    MYLE
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.

  8. #8
    Join Date
    Sep 2005
    Location
    North Carolina, USA
    Posts
    11
    Thanks guys -- that was it. My text field on the actual report was the same name as the underlying field in the table. After I renamed the text field, the expression worked fine. Thanks again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •