Results 1 to 22 of 22

Thread: [RESOLVED] need help on text box

Hybrid View

  1. #1
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: need help on text box

    as the keyascii is not put into the textbox until after this sub is processed, as noted by vivek, this line makes the longnumber to be the content of the textbox (if any) and the keypress that has not yet been put into the textbox. keyascii is a number the ascii value of the character, the chr converts it back to the character that was pressed
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  2. #2

    Thread Starter
    Junior Member
    Join Date
    Aug 2006
    Posts
    28

    Re: need help on text box

    then how can i make num1 to num8 stop accepting anything after the 8th digit because when i enter the 9th digit , it is saved into num8 so is my code correct ?


    VB Code:
    1. If lngNumber <= 8 Then
    2.     num1 = lngNumber \ 10000000
    3.     num2 = (lngNumber \ 1000000) Mod 10
    4.     num3 = (lngNumber \ 100000) Mod 10
    5.     num4 = (lngNumber \ 10000) Mod 10
    6.     num5 = (lngNumber \ 1000) Mod 10
    7.     num6 = (lngNumber \ 100) Mod 10
    8.     num7 = (lngNumber \ 10) Mod 10
    9.     num8 = lngNumber Mod 10
    10.    
    11.     End If

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width