the first number of the entered article in the text box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hannoudw
    New Member
    • Aug 2010
    • 115

    the first number of the entered article in the text box

    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
  • jimatqsi
    Moderator Top Contributor
    • Oct 2006
    • 1293

    #2
    Try this
    Code:
    if left(cstr(txtArticle),1) = "0" then
    '   stuff for the 0s
    elseif left(cstr(txtArticle),1) = "1" then
    '   stuff for the 1s
    elseif left(cstr(txtarticle),1) ="2" then
       ' stuff for the 2s
    elseif left(cstr(txtarticle,1) = "3" then
      ' stuff for the 3's
    'etc...
    else
       ' stuff for none of the above
    endif
    Last edited by jimatqsi; Aug 12 '10, 01:15 PM. Reason: add code for the 0s

    Comment

    Working...