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).
18 1494
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).
Hi. What limits did you have in mind for these numbers?
For instance, do you want to have "one million five hundred thousand and forty two"
Hi. What limits did you have in mind for these numbers?
For instance, do you want to have "one million five hundred thousand and forty two"
up to 10 is fine
up to 10 is fine
can someone please help me I having such a hard time.
can someone please help me I having such a hard time.
You can do it this way using an array and the Split() function
This works though there are no checks on the user input -
Dim stAr(10) As String
-
Dim arInput As Variant
-
Dim stOutput As String
-
Dim intLoop As Integer
-
-
stAr(0) = "zero"
-
stAr(1) = "one"
-
stAr(2) = "two"
-
stAr(3) = "three"
-
stAr(4) = "four"
-
stAr(5) = "five"
-
stAr(6) = "six"
-
stAr(7) = "seven"
-
stAr(8) = "eight"
-
stAr(9) = "nine"
-
stAr(10) = "ten"
-
-
arInput = Split(Me.txtInput.Text, ",")
-
For intLoop = 0 To UBound(arInput) - 1
-
stOutput = stOutput & stAr(CInt(arInput(intLoop))) & ", "
-
Next intLoop
-
stOutput = stOutput & stAr(CInt(arInput(intLoop)))
-
Me.txtOutput.Text = stOutput
-
You can do it this way using an array and the Split() function
This works though there are no checks on the user input -
Dim stAr(10) As String
-
Dim arInput As Variant
-
Dim stOutput As String
-
Dim intLoop As Integer
-
-
stAr(0) = "zero"
-
stAr(1) = "one"
-
stAr(2) = "two"
-
stAr(3) = "three"
-
stAr(4) = "four"
-
stAr(5) = "five"
-
stAr(6) = "six"
-
stAr(7) = "seven"
-
stAr(8) = "eight"
-
stAr(9) = "nine"
-
stAr(10) = "ten"
-
-
arInput = Split(Me.txtInput.Text, ",")
-
For intLoop = 0 To UBound(arInput) - 1
-
stOutput = stOutput & stAr(CInt(arInput(intLoop))) & ", "
-
Next intLoop
-
stOutput = stOutput & stAr(CInt(arInput(intLoop)))
-
Me.txtOutput.Text = stOutput
-
Thanks but can I actually use this with vb
I am actually trying to run it in VB 2005 express edition
Thanks but can I actually use this with vb
I am actually trying to run it in VB 2005 express edition
I really appreciate your help
Thanks again
Thanks but can I actually use this with vb
I am actually trying to run it in VB 2005 express edition
I have no idea if this runs on .NET or not. Why not test it and see.
Put a couple of textboxes on a form with a button and paste this code into the button_click event. I tested the code with VB6
Let us know if it works.
Good luck
I have no idea if this runs on .NET or not. Why not test it and see.
Put a couple of textboxes on a form with a button and paste this code into the button_click event. I tested the code with VB6
Let us know if it works.
Good luck
Thanks for your reply,
everything seems to be fine however, I get an error "variable 'stOutput' is used before it has been assigned a value. A null refference exception could result at runtime" and is this vb coding? I think it is.
Thanks for your reply,
everything seems to be fine however, I get an error "variable 'stOutput' is used before it has been assigned a value. A null refference exception could result at runtime" and is this vb coding? I think it is.
Try this just after the last Dim statement
stOutput = ""
Try this just after the last Dim statement
stOutput = ""
Now I get A different error for this line stOutput = stOutput & stAr(CInt(arInput(intLoop)))
error: Conversion from string "jkhkjh" to type 'Integer' is not valid.
sorry about the stupid question. Yeah it is vb
Try this just after the last Dim statement
stOutput = ""
Now I get a different error for this line stOutput = stOutput & stAr(CInt(arInput(intLoop)))
error: Conversion from string "juji67" to type 'Integer' is not valid.
Now I get a different error for this line stOutput = stOutput & stAr(CInt(arInput(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
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.
Now I get A different error for this line stOutput = stOutput & stAr(CInt(arInput(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 -
Dim stAr(10) As String
-
Dim arInput As Variant
-
Dim stOutput As String
-
Dim intLoop As Integer
-
-
stOutput = ""
-
-
stAr(0) = "zero"
-
stAr(1) = "one"
-
stAr(2) = "two"
-
stAr(3) = "three"
-
stAr(4) = "four"
-
stAr(5) = "five"
-
stAr(6) = "six"
-
stAr(7) = "seven"
-
stAr(8) = "eight"
-
stAr(9) = "nine"
-
stAr(10) = "ten"
-
-
arInput = Split(Me.txtInput.Text, ",")
-
For intLoop = 0 To UBound(arInput) - 1
-
If IsNumeric(arInput(intLoop) Then
-
stOutput = stOutput & stAr(CInt(arInput(intLoop))) & ", "
-
Else
-
MsgBox "Please enter single numbers separated by a comma"
-
Me.txtInput.Text = ""
-
Me.txtInput.SetFocus
-
Exit Sub
-
End If
-
Next intLoop
-
stOutput = stOutput & stAr(CInt(arInput(intLoop)))
-
Me.txtOutput.Text = stOutput
-
This includes a check for numeric entries -
Dim stAr(10) As String
-
Dim arInput As Variant
-
Dim stOutput As String
-
Dim intLoop As Integer
-
-
stOutput = ""
-
-
stAr(0) = "zero"
-
stAr(1) = "one"
-
stAr(2) = "two"
-
stAr(3) = "three"
-
stAr(4) = "four"
-
stAr(5) = "five"
-
stAr(6) = "six"
-
stAr(7) = "seven"
-
stAr(8) = "eight"
-
stAr(9) = "nine"
-
stAr(10) = "ten"
-
-
arInput = Split(Me.txtInput.Text, ",")
-
For intLoop = 0 To UBound(arInput) - 1
-
If IsNumeric(arInput(intLoop) Then
-
stOutput = stOutput & stAr(CInt(arInput(intLoop))) & ", "
-
Else
-
MsgBox "Please enter single numbers separated by a comma"
-
Me.txtInput.Text = ""
-
Me.txtInput.SetFocus
-
Exit Sub
-
End If
-
Next intLoop
-
stOutput = stOutput & stAr(CInt(arInput(intLoop)))
-
Me.txtOutput.Text = stOutput
-
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: helloonetwothree
and if you don't mind can you then try and reverse it
txtInput: OneTwoThreehello
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: helloonetwothree
and if you don't mind can you then try and reverse it
txtInput: OneTwoThreehello
sorry I mean txtOutput: OneTwoThreehello
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: helloonetwothree
and if you don't mind can you then try and reverse it
txtInput: OneTwoThreehello
Great so you now have a working model that you can improve upon and learn from. Happy hunting :)
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
Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
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...
|
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...
|
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...
|
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 ?
|
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.
...
|
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...
|
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...
|
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...
|
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,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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...
| |