473,809 Members | 2,876 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how can I use two txtbox to enter aphanumeric value and change it

12 New Member
how can I use two txtbox to enter aphanumeric value and taking the first value of the textbox and placing it in the second txtbox with the numbers value being change to the actual wording (1,2 changes to one, two).
Nov 11 '06
18 1532
cipher2079
12 New Member
Try this just after the last Dim statement
stOutput = ""
Now I get A different error for this line stOutput = stOutput & stAr(CInt(arInp ut(intLoop)))

error: Conversion from string "jkhkjh" to type 'Integer' is not valid.

sorry about the stupid question. Yeah it is vb
Nov 13 '06 #11
cipher2079
12 New Member
Try this just after the last Dim statement
stOutput = ""

Now I get a different error for this line stOutput = stOutput & stAr(CInt(arInp ut(intLoop)))

error: Conversion from string "juji67" to type 'Integer' is not valid.
Nov 13 '06 #12
cipher2079
12 New Member
Now I get a different error for this line stOutput = stOutput & stAr(CInt(arInp ut(intLoop)))

error: Conversion from string "juji67" to type 'Integer' is not valid.
oh this is page two I was looking for the last post I thought it was on page 1
Nov 13 '06 #13
willakawill
1,646 Top Contributor
oh this is page two I was looking for the last post I thought it was on page 1
Did you copy and paste this code or did you type it in.
There is no error when run under vb6
What is being typed into the first textbox. this should be numbers separated by a comma.
Nov 13 '06 #14
willakawill
1,646 Top Contributor
Now I get A different error for this line stOutput = stOutput & stAr(CInt(arInp ut(intLoop)))

error: Conversion from string "jkhkjh" to type 'Integer' is not valid.

sorry about the stupid question. Yeah it is vb
This includes a check for numeric entries
Expand|Select|Wrap|Line Numbers
  1.     Dim stAr(10) As String
  2.     Dim arInput As Variant
  3.     Dim stOutput As String
  4.     Dim intLoop As Integer
  5.  
  6.     stOutput = ""
  7.  
  8.     stAr(0) = "zero"
  9.     stAr(1) = "one"
  10.     stAr(2) = "two"
  11.     stAr(3) = "three"
  12.     stAr(4) = "four"
  13.     stAr(5) = "five"
  14.     stAr(6) = "six"
  15.     stAr(7) = "seven"
  16.     stAr(8) = "eight"
  17.     stAr(9) = "nine"
  18.     stAr(10) = "ten"
  19.  
  20.     arInput = Split(Me.txtInput.Text, ",")
  21.     For intLoop = 0 To UBound(arInput) - 1
  22.         If IsNumeric(arInput(intLoop) Then
  23.             stOutput = stOutput & stAr(CInt(arInput(intLoop))) & ", "
  24.         Else
  25.             MsgBox "Please enter single numbers separated by a comma"
  26.             Me.txtInput.Text = ""
  27.             Me.txtInput.SetFocus
  28.             Exit Sub
  29.         End If
  30.     Next intLoop
  31.     stOutput = stOutput & stAr(CInt(arInput(intLoop)))
  32.     Me.txtOutput.Text = stOutput
  33.  
Nov 13 '06 #15
cipher2079
12 New Member
This includes a check for numeric entries
Expand|Select|Wrap|Line Numbers
  1.     Dim stAr(10) As String
  2.     Dim arInput As Variant
  3.     Dim stOutput As String
  4.     Dim intLoop As Integer
  5.  
  6.     stOutput = ""
  7.  
  8.     stAr(0) = "zero"
  9.     stAr(1) = "one"
  10.     stAr(2) = "two"
  11.     stAr(3) = "three"
  12.     stAr(4) = "four"
  13.     stAr(5) = "five"
  14.     stAr(6) = "six"
  15.     stAr(7) = "seven"
  16.     stAr(8) = "eight"
  17.     stAr(9) = "nine"
  18.     stAr(10) = "ten"
  19.  
  20.     arInput = Split(Me.txtInput.Text, ",")
  21.     For intLoop = 0 To UBound(arInput) - 1
  22.         If IsNumeric(arInput(intLoop) Then
  23.             stOutput = stOutput & stAr(CInt(arInput(intLoop))) & ", "
  24.         Else
  25.             MsgBox "Please enter single numbers separated by a comma"
  26.             Me.txtInput.Text = ""
  27.             Me.txtInput.SetFocus
  28.             Exit Sub
  29.         End If
  30.     Next intLoop
  31.     stOutput = stOutput & stAr(CInt(arInput(intLoop)))
  32.     Me.txtOutput.Text = stOutput
  33.  
ok it does work however I was hoping to enter a words/letters and numbers without commans and convert the numbers from numeric to the actual world.

ex.

txtInput: hello123

click button

txtOutput: helloonetwothre e

and if you don't mind can you then try and reverse it

txtInput: OneTwoThreehell o
Nov 13 '06 #16
cipher2079
12 New Member
ok it does work however I was hoping to enter a words/letters and numbers without commans and convert the numbers from numeric to the actual world.

ex.

txtInput: hello123

click button

txtOutput: helloonetwothre e

and if you don't mind can you then try and reverse it

txtInput: OneTwoThreehell o

sorry I mean txtOutput: OneTwoThreehell o
Nov 13 '06 #17
willakawill
1,646 Top Contributor
ok it does work however I was hoping to enter a words/letters and numbers without commans and convert the numbers from numeric to the actual world.

ex.

txtInput: hello123

click button

txtOutput: helloonetwothre e

and if you don't mind can you then try and reverse it

txtInput: OneTwoThreehell o
Great so you now have a working model that you can improve upon and learn from. Happy hunting :)
Nov 13 '06 #18
cipher2079
12 New Member
Great so you now have a working model that you can improve upon and learn from. Happy hunting :)
Thanks for all your help. I appriciated
Nov 13 '06 #19

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

Similar topics

15
6584
by: M Smith | last post by:
I have a form I want to submit to itself. I want to be able to type in a list of numbers and submit the form and have that list show up on the same form under the text box I typed them into and the buttons. The problem is when I post a form to itself, the Enter key will not submit the form, it only clears the contents of the text box. The only way I can submit is to click the submit button. Here is a simplified version of my code that I...
1
1668
by: Koen | last post by:
Hi, I have three objects in my form: a listbox (lstform) a subform (fsub) a txtbox (txt) The listbox lists form names that will be displayed in the subform. To do this I use the following line in the afterupdate event of the listbox:
2
1436
by: DD | last post by:
I have a subform on a form In the subform i have a chkBox= and a txtbox= The idea is you Chk and the price $40.00 is automaticly entered into The chkBox has code Private Sub BuffetDinner_Click() 'Automaticly applies $40.00 into Dinner40 txtbox If () = True Then
13
14587
by: Rich | last post by:
Hello, So I would like to disable a textbox on a vb.net form without the text getting grayed out. In vb6 I could place a textbox control on a frame control and disable the frame leaving the textbox enabled and text/background were intact but mouse cursor remained an arraw (as opposed to an I for editable). I tried a Panel control on my .net form since I could I guess there is no longer a frame control (also tried a groupbox control)....
2
3674
by: Boki | last post by:
Hi All, // code start alert("document.all.txtbox"+valueA+".value") // end code could you please advice, can it show the value of txtbox ?
8
3198
by: Jeff | last post by:
A client wants a press of the Enter key in a field on a continuous form to grab the value of that field from the previous record. But if they have typed a value and then hit Enter it shouldn't. I have tried a few ways but the main problem is that after typing a value and hitting Enter it still grabs the value from the previous record, trashing the value they just typed. Any ideas from you lateral thinkers.
2
1420
by: ebasshead | last post by:
Hi Everybody, I have a txtbox that populates itself when the start of the form is filled out. But sometimes I have to change the info in that specific txtbox. At the moment it wont allow me to. Is there a way to override the preexisting data in the txtbox when I click on it, and then enter a different number? Cheers Ed
2
2180
by: HHAAPPYY | last post by:
Hi I am trying to pass value of the textbox along with another value to the query string. when i am retriving the txtbox value it always shows me null, my senario is like this On my page div_admin.asp i have following things.<% Dim page, content,console,banner,navbar
1
1214
by: mailbox73 | last post by:
Hi, c# 2008 express edition. Can anyone please help me figure out why I cannot get any value from one form to another when the controls are databound. (the formY.txtbox lands up empty) in formY I write in the load event: Formx frmx = new Formx(); txtCustomer.Text = frmx.customerIdTextBox.Text;
0
9721
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9600
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10633
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...
0
10376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10114
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9198
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...
0
5548
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
5686
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3011
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.