473,406 Members | 2,816 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,406 software developers and data experts.

the first number of the entered article in the text box

115 100+
Hi .
I have a form that contains 2 text box , one is (txtArticle) represents the article number. and the other one represents the size (txtsize) , i want when i choose the txtArticle to see if the txtArticle begins with 0 to do some thing ( set another text box to visible).
and if the chosen txtArticle begins with 1 to do something else ...., and if it begins with 2 , also another thing ... is there any method i can take the 1st digit number from the txtArticle??
my Article number is a saved in the database as number , and can maximum be 7 digit!
any help please
Aug 11 '10 #1

✓ answered by jimatqsi

Try this
Expand|Select|Wrap|Line Numbers
  1. if left(cstr(txtArticle),1) = "0" then
  2. '   stuff for the 0s
  3. elseif left(cstr(txtArticle),1) = "1" then
  4. '   stuff for the 1s
  5. elseif left(cstr(txtarticle),1) ="2" then
  6.    ' stuff for the 2s
  7. elseif left(cstr(txtarticle,1) = "3" then
  8.   ' stuff for the 3's
  9. 'etc...
  10. else
  11.    ' stuff for none of the above
  12. endif
  13.  

1 1176
jimatqsi
1,271 Expert 1GB
Try this
Expand|Select|Wrap|Line Numbers
  1. if left(cstr(txtArticle),1) = "0" then
  2. '   stuff for the 0s
  3. elseif left(cstr(txtArticle),1) = "1" then
  4. '   stuff for the 1s
  5. elseif left(cstr(txtarticle),1) ="2" then
  6.    ' stuff for the 2s
  7. elseif left(cstr(txtarticle,1) = "3" then
  8.   ' stuff for the 3's
  9. 'etc...
  10. else
  11.    ' stuff for none of the above
  12. endif
  13.  
Aug 12 '10 #2

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

Similar topics

3
by: Mark | last post by:
I have a website with an increasing amount of articles and news reports and so I am thinking of moving away from storing each article as a seperate page to having a single page and storing articles...
36
by: Wei Su | last post by:
Hi, I have a text file abc.txt and it looks like: 12 34 56 23 45 56 33 56 78 ... .. .. ... .. .. I want to get how many rows totally in the text file, how to do this? Thanks.
6
by: mm | last post by:
Hi all I have a string example like this TSOP65P640X120-20N M 0 0 0 3 9 0 20 1 0 The first number in this case is 6 but it can be between 0 and 9 The first number can be on place between 2...
3
by: Henry Stockbridge | last post by:
Hi, I am trying to write query expression that finds the position of the first number in a string. So, this recordset... DUS2345.4 D2789.6 .... would return the following positons
1
by: den | last post by:
<input id="txtTop" type="text" onkeyup="fun_control(this)"/> function fun_control(var2) { if ((var2.value== 0) || (var2.value== 1) || (var2.value== 2) || (var2.value== 3) ) {alert('ok is a ...
5
by: Aboone | last post by:
Hello, I woudl like to dispaly the order number which has been entered into a previous record on a new record. I am unable to use an autonumber as our Order number format is constantly...
2
by: foss | last post by:
Hi friends, My form have a text field named "price" which should have only number and if it contains decimal number then it should not have more than two numbers after decimal. I tried this but it...
4
by: darith | last post by:
Hi all, I want to know code in vb.net to get number of selected text in MS Word. how can we write? Please help me. I need it urgent. in textbox we just write textbox.selectedtext so we can get...
13
by: sarega | last post by:
Hi, Here am trying to populate the page with new url, with the value that is being entered in the text box. this is the php code called example.php <? echo "<input type='text' name='text1'...
4
by: sarega | last post by:
Hi, I have a text box, when a user enters some value into the text box, that value has to be populated in the url and as well as the value entered in that text box has to be retained. <? echo...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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...
0
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...
0
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...
0
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...

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.