Results 1 to 7 of 7
  1. #1
    nyarborough
    Guest

    trim function problem in 97 sr2?

    In attempting to use the label wizard in 97 SR2, when finish is clicked I get an error. When I open the label report all fields contain the ##NAME?? error code. I don't have this problem when the same database is opened under SR1. Digging further, it seems to be the TRIM function that <img src=/w3timages/censored.gif alt=[censored] border=0> it out. Any ideas on how to fix this problem (other than re-install Access upto SR1)? <img src=/S/frown.gif border=0 alt=frown width=15 height=15>

  2. #2
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Newbury, Berkshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: trim function problem in 97 sr2?

    The label printing in access isn

  3. #3
    nyarborough
    Guest

    Re: trim function problem in 97 sr2?

    Rupert,
    Thanks, I did strip out the Trim function and the labels printed, but field spacing is fixed which doesn't look very good. Trying to add the trim back to the text box control: =Trim([field1]&" "&[field2]) should give "field1 field2" as in a first and last name on the label, but 97 SR2 just won't accept the trim function in a text box control on a form. Again, this works fine in 97 SR1 (I developed this small app on 97 SR1, and deployed onto 97 SR2 for end user). I would rather not link to Word, just to keep it simple. Thanks again!

  4. #4
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Newbury, Berkshire, England
    Posts
    712
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: trim function problem in 97 sr2?

    Try: =Trim([field1])&" "&Trim([field2])

  5. #5
    nyarborough
    Guest

    Re: trim function problem in 97 sr2?

    Thanks, but I got to thinking about what Trim does, it removes leading and trailing spaces from a string, right? My string is composed of two fields being "first_name" and "last_name", there ain't gonna be no spaces to remove unless the user types in a bunch of spaces when entering names into the db. Duh! so I just built the string without the Trim function, it isn't necessary. I'm not sure why the label wizard would insert that function into the text box control anyway. Also, I don't know why SR1 works with trim in a text control box and SR2 doesn't. Whatever...

    Thanks again for your response!
    Noel

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: trim function problem in 97 sr2?

    Trim works just fine in SR2, so if you're getting the #Name? error, it's probably a reference issue. If you have a control with the same name as the underlying field and you insert a function like trim into the control's datasource, you'll always get a #Name? error or just and #Error? because it can't handle the circular reference.
    Charlotte

  7. #7
    nyarborough
    Guest

    Re: trim function problem in 97 sr2?

    Charlotte,
    The label wizard set-up the offending control, opening the same database with SR1 works, with SR2, it doesn't (on two different computers). The only difference I could find was SR1 vs. SR2. Anyhow, as I had mentioned in earlier post, I removed the trim function from the control so my syntax is: = [first_name]& " " &[last_name]. It works and looks good printed, the trim isn't really needed here. Worst case I get a few extraneous spaces thrown in, but its just mailing labels, so no big deal. Btw, the label wizard named the text control boxes text1, text2, text3, etc. The fields first_name and last_name come from a table named instructor_data, so circular reference doesn't seem to be the problem in this case. The cause may remain a mystery. I have the labels printing like I want, so I'll consider it case closed.
    Thanks for your input! <img src=/S/smile.gif border=0 alt=smile width=15 height=15>
    Noel

Posting Permissions

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