Results 1 to 10 of 10
  1. #1
    ZMac is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2010
    Location
    Minnesota, USA
    Posts
    8

    Trim Function

    Hello,

    Hope I can explain my problem so that it makes sense.

    I am having a problem creating an address block in Access 2007 report. I have a 5 field address; Name1, Name2, Address1, Address2, CityStateZip. (The fields Name2 and Address2 do not always have information for each record.)

    When I create a report I am getting a blank line when there isn't information for fields Name2 and Address2. I am using the Trim function and have set the properties to each of the fields to "shrink".

    This is how the address block is printing:
    JOHN DOE



    1234 Anywhere Ave S

    City XX 12345

    I want it to look like this:
    JOHN DOE
    1234 Anywhere Ave S
    City XX 12345

    This works correctly on reports I have previously created in Access 2003. I have even tried coping & pasting the fields from Access 2003 into Access 2007 but still can't get it to work.

    Does my problem have anything to do with "grouping"? I can't seem to find anywhere in the report module to "group" items.

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Did you set the Detail section CanShrink property true?

  3. #3
    ZMac is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2010
    Location
    Minnesota, USA
    Posts
    8
    Yes I did. Seems very strange that it doesn't work. Like I've said, I have even tried copy/paste from a report in Access2003 that does work property into my report in Access2007 database but it doesn't "shrink" the fields that do not contain information.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Can you post the db so we can play with it? Remove any sensitive data of course.

  5. #5
    ZMac is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2010
    Location
    Minnesota, USA
    Posts
    8
    I just tried adding the "address block" into the the report header section and that appears to have solved the problem.

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Can Shrink works *if* there is not something else on that line. Try moving the controls up above the Invoice Date stuff on the right and you will see the shrink works. You need to turn it on first.

  7. #7
    ZMac is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2010
    Location
    Minnesota, USA
    Posts
    8
    Rural Guy,

    Sorry, I was editing my previous post as you were apparently responding. Moving the "address block" into the header section appears to have solved my problem. Thank you for all your help.

  8. #8
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I just moved them up so they were on a different line from the Date Controls on the right but still in the Detail section of the report and it works. If you're satisfied with the solution then go ahead and mark this thread as Solved.

  9. #9
    ZMac is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2010
    Location
    Minnesota, USA
    Posts
    8
    Your solution has helped me understand what the actual problem was. This will be very helpful in the future. Thanks again for all your help.

    How do I mark this as solved?

  10. #10
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 Access 2007
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    Follow the link in my signature.

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

Similar Threads

  1. Need Help with TRIM command
    By rbfarley in forum Reports
    Replies: 3
    Last Post: 01-08-2010, 02:03 PM
  2. Want function to get current function name
    By Davis DeBard in forum Programming
    Replies: 2
    Last Post: 08-13-2009, 05:02 AM
  3. COPY DATA and TRIM
    By Ed H in forum Access
    Replies: 1
    Last Post: 01-01-2009, 07:01 AM
  4. Is there a function to do this....
    By Nowherefast in forum Access
    Replies: 2
    Last Post: 12-31-2008, 08:08 AM
  5. Trim
    By JMantei in forum Forms
    Replies: 1
    Last Post: 06-20-2006, 02:06 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