473,698 Members | 2,218 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multiple Relpace string question

4 New Member
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 1483
vbisjustforme
4 New Member
guys if anyone is intersted in this thread this is how i went about an unothordox way to solve my problem


Private Sub txtpass_LostFoc us()
txtpass1 = Replace(txtpass , "&", "%26", 1, -1, vbBinaryCompare )
txtpass2 = Replace(txtpass 1, "#", "%23")
txtpass3 = Replace(txtpass 2, "+", "%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
4075
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
14852
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 ((someString.IndexOf("something1",0) >= 0) || ((someString.IndexOf("something2",0) >= 0) ||
9
2769
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 wizards. But, I have found that trying to do something "outside the norm" adds a rather large level of complexity and/or data replication. Background I have been commissioned to create a web-based application for a client. It has a formsaunthentication...
6
3987
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 string UID; public string PWD; }
0
9157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8893
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7723
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5860
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4366
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3045
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2328
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.