Results 1 to 9 of 9
  1. #1
    Join Date
    Nov 2004
    Posts
    47

    Unanswered: Multiple fields in a single text box

    Hi all,

    Is it possible to show multiple fields in a single text box in a report? I have separated an adress line in 2 different fields, but id' like to show them in a single line, preferably in the same textbox, without having a white space between the two...

    I read a couple thing about it in the forum, and help files but nothing really answered my question.

    My guess is its prolly possible by changing the control source of my textbox in the textbox properties by inserting something like... =[adr post 1] & [adr post 2] ... but nothing is working yet,

    Id appreciate the help,

    Thanks in advance!

    Fuujin

  2. #2
    Join Date
    Apr 2002
    Location
    Illinois
    Posts
    133
    One option is to create a field in the query that the report is based on that concatinates the fields, then set that field as the control source for the text box on the report.
    SteveH

  3. #3
    Join Date
    Nov 2004
    Posts
    47
    Sounds nice! but how do you do this???

  4. #4
    Join Date
    Sep 2004
    Location
    Tampa, FL
    Posts
    520
    My guess is its prolly possible by changing the control source of my textbox in the textbox properties by inserting something like... =[adr post 1] & [adr post 2] ... but nothing is working yet
    That is exactly what you sould do.
    Darasen

  5. #5
    Join Date
    Apr 2002
    Location
    Illinois
    Posts
    133
    In the query, go to a new field and in the field name type:

    FullAddr: trim([adr post 1]) & " " & trim([adr post 2])

    The "trim" function eliminates spaces at the beginning or end of the field.
    SteveH

  6. #6
    Join Date
    Feb 2004
    Location
    Chicago, IL
    Posts
    1,312
    What you entered should work:

    =[adr post 1] & [adr post 2]

    One reason why this may not have worked is, if you add fields to your report from the field list the default name is the name of the field. So the text box name would be 'adr post 1' in your example. If you then changed the Control Source to the above Access gets confused because you could be referencing the text box 'adr post 1' of the data in the field 'adr post 1'. I would bet that if you changed the name of the textbox (Name property in the Other tab) that the above would work for you. When you see Name? instead of the result you were expecting then first think typo then think name of the control.

    My other suggestion would be to add a space between the two with:

    =[adr post 1] & " " & [adr post 2]

  7. #7
    Join Date
    Nov 2004
    Posts
    47
    Thanks a lot guys!!!

    works perfectly!

  8. #8
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Hi fuujin,

    Might I suggest practicing naming your fields WITHOUT spaces. That is not a good practice and gets a bit messy over time. Either do this:

    [adr_post_1] or [txtadr_Post1] or [txtAdrPost1] or [AdrPost1]

    Myself, I prefer the last two. REASON: It's just plain easy to not have to reach up to hit the Underline key if the name have two or more sections as yours does.

    Have a nice one,
    BUD

  9. #9
    Join Date
    Nov 2004
    Posts
    47
    LoL, yeah!! But I've always been messy! Thanks for the tip

Posting Permissions

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