|
-
Aug 3rd, 2006, 10:07 PM
#1
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
-
Aug 3rd, 2006, 10:18 PM
#2
Thread Starter
Junior Member
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:
If lngNumber <= 8 Then
num1 = lngNumber \ 10000000
num2 = (lngNumber \ 1000000) Mod 10
num3 = (lngNumber \ 100000) Mod 10
num4 = (lngNumber \ 10000) Mod 10
num5 = (lngNumber \ 1000) Mod 10
num6 = (lngNumber \ 100) Mod 10
num7 = (lngNumber \ 10) Mod 10
num8 = lngNumber Mod 10
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|