Results 1 to 8 of 8

Thread: Using a "/" in a Address Field....Keep getting an error.

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2002
    Posts
    22

    Using a "/" in a Address Field....Keep getting an error.

    I have a VB app that has a address field that allows / in the address. I also know that Crystal uses / in its formulas. How could I pass crystal a / in an address field and not have it error out?


    Thanks for the help.

    Frank

  2. #2
    Frenzied Member pnish's Avatar
    Join Date
    Aug 2002
    Location
    Tassie, Oz
    Posts
    1,918
    You shouldn't have any problems passing a /. Is the / coming directly from the database or is it being passed as a formula? I tried both methods and had no problems.

    Can you be a bit more specific about what you're actually doing and what error occurs.

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Perhaps the "/" is OK for Crystal to use, but not to have it as a passed character.

    Try Chr(47) instead.

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Sep 2002
    Posts
    22
    The address is a default company value. It is stored in the database. What happens is this. If a default company address of......

    ABC Company
    25 1/2 Main Street
    Charlotte, NC. 28075

    The address would cause this to error when i print an invoice(crystal) remove the / and it prints just fine.

    I guess what i need is to check the address field for /, but how would i pass the address field to crystal so that it will print... 25 1/2 Main Street?

    Thanks
    Frank

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333
    Try
    Code:
    "25 1 " & chr(47) & "2 main street"

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Sep 2002
    Posts
    22
    If 25 1/2 Main Street is actually stored in ADDRESS1 how would i apply the chr(47) to ADDRESS1?

    Thanks
    Frank

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Sep 2002
    Posts
    22
    Anyone.....? If i did a search for "/" and replace with Chr(47) wouldn't that be the same a searhing for "/" and replacing with "/" ?

    This post is in regards to my previous post.

    Thanks

  8. #8

    Thread Starter
    Junior Member
    Join Date
    Sep 2002
    Posts
    22
    If i remove any of the '/' and run the project, i get an error that
    says -2147191854 = The remaining text does not seem to be part of the formula. Let me explain, and please correct me if i'm wrong, i have been told that in this example @CompanyAddress is the field on the report and strCompanyAddress is the field to populate @CompanyAddress. Being new to all of this, and this is what i have, what would have been a better way to have written this fomula?

    Thanks

    Below is the formula:

    'Formula string
    strFormula = "{@CompanyName}" & Chr$(34) & strCompanyName
    strFormula = strFormula & Chr$(34) & "/{@CompanyAddress}" & Chr$(34) & strCompanyAddress
    strFormula = strFormula & Chr$(34) & "/{@CompanyCSZ}" & Chr$(34) & strCompanyCSZ
    strFormula = strFormula & Chr$(34) & "/{@CompanyPhone}" & Chr$(34) & strCompanyPhone
    strFormula = strFormula & Chr$(34) & "/{@DateRange}" & Chr$(34) & strDateRange
    strFormula = strFormula & Chr$(34) & "/{@EmployeeType}" & Chr$(34) & strEmployeeType & Chr$(34)
    Last edited by fvlmasl2; Oct 30th, 2002 at 03:58 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
  •  



Click Here to Expand Forum to Full Width