473,382 Members | 1,786 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Multiple Relpace string question

sup guys, hit a mental snag an need some help.

i want to search a defined string (textbox),
and replace all characters in that string to Hex(KeyAscii) with "%" in front of the Hex(KeyAscii) right

now my problem is i can do this in the textchange and keypress etc with one replace function eg . txtpass1 = Replace(txtpass, "&", "%26")

works no probs ... however there are multiple instances i need to change if they are present in txtpass eg.

txtpass1 = Replace(txtpass, "&", "%26")
txtpass1 = Replace(txtpass, ",", "%2C")
txtpass1 = Replace(txtpass, "<", "%3C")
txtpass1 = Replace(txtpass, ">", "%3E")
txtpass1 = Replace(txtpass, "!", "%21")
txtpass1 = Replace(txtpass, "@", "%40")
txtpass1 = Replace(txtpass, "#", "%23")

and its just not working!!
txtpass1 is returning as txtpass is

any idea's??

btw this would work to if i could figure it out ...

Private Sub txtpass_Change()
txtpass1 = "%" & Hex(KeyAscii)
end sub

any chance i can fix that to make it work??

thanks
Sep 5 '06 #1
1 1470
guys if anyone is intersted in this thread this is how i went about an unothordox way to solve my problem


Private Sub txtpass_LostFocus()
txtpass1 = Replace(txtpass, "&", "%26", 1, -1, vbBinaryCompare)
txtpass2 = Replace(txtpass1, "#", "%23")
txtpass3 = Replace(txtpass2, "+", "%2B")
End Sub

Private Sub txtpass1_Change()
txtpass2 = txtpass1
End Sub

Private Sub txtpass2_Change()
txtpass3 = txtpass2
End Sub


it worked so im happy :D
Sep 5 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Drew | last post by:
I have a db table like the following, UID, int auto-increment RegNo Person Relation YearsKnown Now here is some sample data from this table,
32
by: tshad | last post by:
Can you do a search for more that one string in another string? Something like: someString.IndexOf("something1","something2","something3",0) or would you have to do something like: if...
9
by: Graham | last post by:
I have been having some fun learning and using the new Controls and methods in .Net 2.0 which will make my life in the future easier and faster. Specifically the new databinding practises and...
6
by: Joseph Geretz | last post by:
I have the following class which I am serializing and passing back and forth between my Web Service application and the client. public class Token : SoapHeader { public string SID; public...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.