473,799 Members | 3,098 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 #1
18 1530
willakawill
1,646 Top Contributor
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"
Nov 11 '06 #2
cipher2079
12 New Member
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
Nov 11 '06 #3
cipher2079
12 New Member
up to 10 is fine

can someone please help me I having such a hard time.
Nov 11 '06 #4
willakawill
1,646 Top Contributor
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
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.     stAr(0) = "zero"
  7.     stAr(1) = "one"
  8.     stAr(2) = "two"
  9.     stAr(3) = "three"
  10.     stAr(4) = "four"
  11.     stAr(5) = "five"
  12.     stAr(6) = "six"
  13.     stAr(7) = "seven"
  14.     stAr(8) = "eight"
  15.     stAr(9) = "nine"
  16.     stAr(10) = "ten"
  17.  
  18.     arInput = Split(Me.txtInput.Text, ",")
  19.     For intLoop = 0 To UBound(arInput) - 1
  20.         stOutput = stOutput & stAr(CInt(arInput(intLoop))) & ", "
  21.     Next intLoop
  22.     stOutput = stOutput & stAr(CInt(arInput(intLoop)))
  23.     Me.txtOutput.Text = stOutput
  24.  
Nov 11 '06 #5
cipher2079
12 New Member
You can do it this way using an array and the Split() function

This works though there are no checks on the user input
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.     stAr(0) = "zero"
  7.     stAr(1) = "one"
  8.     stAr(2) = "two"
  9.     stAr(3) = "three"
  10.     stAr(4) = "four"
  11.     stAr(5) = "five"
  12.     stAr(6) = "six"
  13.     stAr(7) = "seven"
  14.     stAr(8) = "eight"
  15.     stAr(9) = "nine"
  16.     stAr(10) = "ten"
  17.  
  18.     arInput = Split(Me.txtInput.Text, ",")
  19.     For intLoop = 0 To UBound(arInput) - 1
  20.         stOutput = stOutput & stAr(CInt(arInput(intLoop))) & ", "
  21.     Next intLoop
  22.     stOutput = stOutput & stAr(CInt(arInput(intLoop)))
  23.     Me.txtOutput.Text = stOutput
  24.  
Thanks but can I actually use this with vb
I am actually trying to run it in VB 2005 express edition
Nov 11 '06 #6
cipher2079
12 New Member
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
Nov 11 '06 #7
willakawill
1,646 Top Contributor
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
Nov 11 '06 #8
cipher2079
12 New Member
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.
Nov 13 '06 #9
willakawill
1,646 Top Contributor
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 = ""
Nov 13 '06 #10

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

Similar topics

15
6582
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
14582
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
3673
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
3197
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
1419
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
2179
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
9687
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
9541
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,...
1
10225
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
9072
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
7564
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
6805
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();...
1
4139
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
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2938
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.