Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Spell Check, kind of

Posted on 2012-03-16
13
Medium Priority
?
352 Views
Last Modified: 2012-03-21
I have a form with a submit button.
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"

Open in new window


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
0
Comment
Question by:TIgerV
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 3
  • +1
13 Comments
 
LVL 15

Expert Comment

by:Simon Ball
ID: 37729640
field = replace(field,"&","")

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 ""
0
 
LVL 15

Expert Comment

by:Simon Ball
ID: 37729646
or just use replace(...) in the concat string.
0
 

Author Comment

by:TIgerV
ID: 37729669
Where do I put that?
Also- Isn't there a command to NOT ALLOW that key?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37729829
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&callerID=1234567890&user=callme&pass=callme"

Application.FollowHyperlink strMyHyperLink

JeffCoachman
0
 
LVL 46

Expert Comment

by:aikimark
ID: 37730181
Instead of removing the ampersands, encode them to URI standards.  

There are two choices:
* Change all "&" with "&"
* Change all "&" with "%26"
0
 

Author Comment

by:TIgerV
ID: 37730193
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.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37730459
did you try my suggestion?
0
 

Author Comment

by:TIgerV
ID: 37730492
Your suggestion does not solve the issue of too many "&" signs.
0
 
LVL 46

Expert Comment

by:aikimark
ID: 37730577
did you to the %26 conversion?
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 37730580
..works fine for me...
0
 

Author Comment

by:TIgerV
ID: 37748393
The API does not accept %26, only a real "&".
0
 
LVL 46

Expert Comment

by:aikimark
ID: 37748432
have you tried repeating the ampersand character?

(like we do when we need a quote character inside a quoted string)
0
 
LVL 46

Accepted Solution

by:
aikimark earned 2000 total points
ID: 37749638
This will replace all the ampersand characters with space characters.

Application.FollowHyperlink "http://server3/alert/phone.aspx/SendTTS?msg=This is building" & Replace(Me.Ctl1Building, "&"," ") & ". " & Replace(Me.Ctl1Area, "&"," ") & ".  We have " & Replace(Me.Ctl1Assigned, "&"," ") & " Personnel Assigned. There are " & Replace(Me.Ctl1Accounted_For, "&"," ") & ". Personnel Present. " & "&numbers=1324657980&callerID=1234567890&user=callme&pass=callme"

Open in new window

0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article helps those who get the 0xc004d307 error when trying to rearm (reset the license) Office 2013 in a Virtual Desktop Infrastructure (VDI) and/or those trying to prep the master image for Microsoft Key Management (KMS) activation. (i.e.- C…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question