Results 1 to 5 of 5

Thread: Truncate fields in a report

  1. #1

    Thread Starter
    Hyperactive Member Art W.'s Avatar
    Join Date
    Apr 2002
    Location
    In My Own Little World, But that’s OK because they know me there!
    Posts
    271

    Truncate fields in a report

    Hello Everyone:

    I am trying to truncate fields in a report. Say you have a number of different names. If you put the fields in the report, they will have white space in them.

    First------------------------middle----------------------last.

    I had to put the -'s in because it autmatically took them out.

    How can I make it so that they come out more like this?

    First middle last with no spaces.

    Thanks

    Art W.
    SLEEP: A Totally Inadequate Substation For Caffeine!

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Truncate fields in a report

    what application are you working in?
    what type of fields have you inserted?
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3

    Thread Starter
    Hyperactive Member Art W.'s Avatar
    Join Date
    Apr 2002
    Location
    In My Own Little World, But that’s OK because they know me there!
    Posts
    271

    Re: Truncate fields in a report

    Hi Everyone:

    I am using MS Access 07, trying to bring text felds together.

    Thanks

    Art W.
    SLEEP: A Totally Inadequate Substation For Caffeine!

  4. #4
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Truncate fields in a report

    sorry i know nothing about access fields
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  5. #5
    Hyperactive Member
    Join Date
    Oct 2010
    Location
    Indiana
    Posts
    457

    Re: Truncate fields in a report

    You can create an Access Query with the information that you need. Within the Query you can combine multiple fields from the table, Such as;

    Code:
    fullname: [First] & [Middle] & [Last]
    I know you said that you didn't want any spaces or anything, but as an idea you can also include other characters, such as;

    Code:
    fullname: [Last] & ", " & [First] & [Middle]
    you may also use the Nz function of Access to eliminate any errors due to having a null value in a field, like;

    Code:
    fullname: Nz([First], "") & Nz([Middle], "") & Nz([Last], "")

Posting Permissions

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



Click Here to Expand Forum to Full Width