Click to See Complete Forum and Search --> : Using a "/" in a Address Field....Keep getting an error.
fvlmasl2
Oct 25th, 2002, 03:01 PM
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
pnish
Oct 25th, 2002, 03:28 PM
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.
Hack
Oct 25th, 2002, 06:16 PM
Perhaps the "/" is OK for Crystal to use, but not to have it as a passed character.
Try Chr(47) instead.
fvlmasl2
Oct 25th, 2002, 06:48 PM
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
Hack
Oct 25th, 2002, 06:53 PM
Try"25 1 " & chr(47) & "2 main street"
fvlmasl2
Oct 26th, 2002, 07:52 AM
If 25 1/2 Main Street is actually stored in ADDRESS1 how would i apply the chr(47) to ADDRESS1?
Thanks
Frank
fvlmasl2
Oct 27th, 2002, 08:41 AM
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
fvlmasl2
Oct 30th, 2002, 10:17 AM
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)
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.