TIgerV
asked on
Spell Check, kind of
I have a form with a submit button.
The submit button runs code that pulls information from the form to create a url.
The trouble is that if any of the fields contain an "&" sign, the code drops from that point, and I only get a partial report.
To fix this, before executing this code, I want to search all the fields for an "&" and remove it if it exists. Can it be done?
Tony
The submit button runs code that pulls information from the form to create a url.
Application.FollowHyperlink "http://server3/alert/phone.aspx/SendTTS?msg=This is building" & Me.Ctl1Building & ". " & Me.Ctl1Area & ". We have " & Me.Ctl1Assigned & " Personnel Assigned. There are " & Me.Ctl1Accounted_For & ". Personnel Present. " & "&numbers=1324657980&callerID=1234567890&user=callme&pass=callme"
The trouble is that if any of the fields contain an "&" sign, the code drops from that point, and I only get a partial report.
To fix this, before executing this code, I want to search all the fields for an "&" and remove it if it exists. Can it be done?
Tony
or just use replace(...) in the concat string.
ASKER
Where do I put that?
Also- Isn't there a command to NOT ALLOW that key?
Also- Isn't there a command to NOT ALLOW that key?
Build the hyperlink in a variable *First*, ...then do follow hyperlink...
Dim strMyHyperLink as string
strMyHyperLink ="http://server3/alert/phone.aspx/SendTTS?msg=This is building" & Me.Ctl1Building & ". " & Me.Ctl1Area & ". We have " & Me.Ctl1Assigned & " Personnel Assigned. There are " & Me.Ctl1Accounted_For & ". Personnel Present. " & "&numbers=1324657980&calle rID=123456 7890&user= callme&pas s=callme"
Application.FollowHyperlin k strMyHyperLink
JeffCoachman
Dim strMyHyperLink as string
strMyHyperLink ="http://server3/alert/phone.aspx/SendTTS?msg=This is building" & Me.Ctl1Building & ". " & Me.Ctl1Area & ". We have " & Me.Ctl1Assigned & " Personnel Assigned. There are " & Me.Ctl1Accounted_For & ". Personnel Present. " & "&numbers=1324657980&calle
Application.FollowHyperlin
JeffCoachman
Instead of removing the ampersands, encode them to URI standards.
There are two choices:
* Change all "&" with "&"
* Change all "&" with "%26"
There are two choices:
* Change all "&" with "&"
* Change all "&" with "%26"
ASKER
The problem is that if one of the fields contains an "&", it breaks up the API input. I need to remove any "&" sign within the fields before making the URL.
did you try my suggestion?
ASKER
Your suggestion does not solve the issue of too many "&" signs.
did you to the %26 conversion?
..works fine for me...
ASKER
The API does not accept %26, only a real "&".
have you tried repeating the ampersand character?
(like we do when we need a quote character inside a quoted string)
(like we do when we need a quote character inside a quoted string)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
chec in help for the replace paramaters... it has start position, and replace all instances too..
so you can start at the nth character and replace 1st, or all instaces of & with ""