|
-
May 21st, 2007, 08:02 PM
#1
Thread Starter
New Member
Importent Error...
Hi
I am using a shortcut of an exe in network system.
that is developed with vb 6.0 .
if entering any numeric value in a text box it is showing 2 in the text box
but it is saving properly.
in the key press event i am converting
the keyascii in to number [For number validation].
if any one have any idea plzzzzzzzzzzzzzzzzzz help.........
-
May 21st, 2007, 08:12 PM
#2
Re: Importent Error...
Welcome to Forums!
I'm not sure what you're asking...
-
May 22nd, 2007, 06:23 AM
#3
Re: Importent Error...
 Originally Posted by Nelakandan_m
in the key press event i am converting
the keyascii in to number [For number validation].
Welcome to the forums. 
What is the code in the keypress event?
-
May 22nd, 2007, 09:58 AM
#4
PowerPoster
Re: Importent Error...
 Originally Posted by RhinoBull
I'm not sure what you're asking... 
I had to read it a few times to get the gist of it.
I think his problem is that he has 2 textboxes and when he types a number in one it puts the ASCII value in the other box (maybe just for testing purposes for now), and it is putting the ASCII value as 2 when it shouldn't be
I think we'll need to see source to work this problem out :-)
Well, everyone else has been doing it :-)
Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
Expect more to come in future
If I have helped you, RATE ME! :-)
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
-
May 22nd, 2007, 10:43 AM
#5
PowerPoster
Re: Importent Error...
If KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then
If KeyAscii <> Asc(Chr(8)) And KeyAscii <> Asc("-") Then
KeyAscii = 0
Beep
End If
End If
===================================================
If your question has been answered, mark the thread as [RESOLVED]
-
May 22nd, 2007, 10:51 AM
#6
PowerPoster
Re: Importent Error...
There is another way to do this.
For the record:
0 - 9 ASCII codes are 48-57
asc(chr(8)) is redundant, as it returns 8...you're ASCIIing the CHR code which was originally what you wanted anyway :-)
- is 45
vb Code:
if NOT (keyascii = 45 or keyascii = 48 or (keyascii>47 and keyascii<58)) then keyascii = 0:beep
Edit: I've tested this and it blocks all keypresses except the ones you add in the statement. NOT is used here to invert logic...rather than doing it if any are true (note if you did that you wouldn't use the brackets after NOT and at the end) you'd do it if all are false :-)
Well, everyone else has been doing it :-)
Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
Expect more to come in future
If I have helped you, RATE ME! :-)
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
-
May 22nd, 2007, 11:00 AM
#7
PowerPoster
Re: Importent Error...
I used
Asc(Chr(8))
because I didn't know how to check for backspace.
===================================================
If your question has been answered, mark the thread as [RESOLVED]
-
May 22nd, 2007, 11:03 AM
#8
PowerPoster
Re: Importent Error...
8 is the ASCII code you need, basically, so you can turn "asc(chr(8))" into "8"
However, I think "IsNumeric" might be a better way to handle this anyway :-)
Well, everyone else has been doing it :-)
Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
Expect more to come in future
If I have helped you, RATE ME! :-)
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
-
May 22nd, 2007, 11:07 AM
#9
Re: Importent Error...
 Originally Posted by Pasvorto
I didn't know how to check for backspace.
Backspace is vbKeyBack
-
May 22nd, 2007, 11:16 AM
#10
PowerPoster
===================================================
If your question has been answered, mark the thread as [RESOLVED]
-
May 22nd, 2007, 11:20 AM
#11
PowerPoster
Re: Importent Error...
And vbBackKey value is going to be 8, it's just a constant that can be used in place of the value if you can't remember it :-)
Well, everyone else has been doing it :-)
Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
Expect more to come in future
If I have helped you, RATE ME! :-)
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
-
May 22nd, 2007, 11:25 AM
#12
PowerPoster
===================================================
If your question has been answered, mark the thread as [RESOLVED]
-
May 22nd, 2007, 12:16 PM
#13
Re: Importent Error...
11 (!) replies (excluding this one) and none from the original poster...
-
May 22nd, 2007, 12:24 PM
#14
PowerPoster
Re: Importent Error...
Not like that's the first time it's happened...happened all the time when I used to post here before :-)
Well, everyone else has been doing it :-)
Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
Expect more to come in future
If I have helped you, RATE ME! :-)
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
-
May 22nd, 2007, 12:36 PM
#15
PowerPoster
Re: Importent Error...
And with this sound of desperation..
plzzzzzzzzzzzzzzzzzz help.........
===================================================
If your question has been answered, mark the thread as [RESOLVED]
-
May 22nd, 2007, 02:10 PM
#16
Lively Member
Re: Importent Error...
um wow i read through what he said like 4 times and still don't understand, it seems like you guys were kinda on the right track, hah who knows, obviously it wasn't THAT big of a problem or he would have more than 1 post.
:-D
i think it should say [RESOLVED]
p.s. --- important.
-
May 22nd, 2007, 02:11 PM
#17
PowerPoster
Re: Importent Error...
 Originally Posted by ixtrip
obviously it wasn't THAT big of a problem or he would have more than 1 post.
We get a lot of post and runners here...most people say thanks, some even mark posts when they're resolved...but we're used to it :-)
Well, everyone else has been doing it :-)
Loading a file into memory QUICKLY - Using SendKeys - HyperLabel - A highly customisable label replacement - Using resource files/DLLs with VB - Adding GZip to your projects
Expect more to come in future
If I have helped you, RATE ME! :-)
I love helping noobs with their VB problems (probably because, as an amateur programmer, I am only slightly better at VB than them :-)) but if you SERIOUSLY want to get help for free from a community such as VBForums, you have to first have a grounding (basic knowledge) in VB6, otherwise you're way too much work to help...You've got to give a little if you want to get help from us, in other words!
And we DON'T do your homework. If your tutor doesn't teach you enough to help you make the project without his or her help, FIND A BETTER TUTOR or try reading books on programming! We are happy to help with minor things regarding the project, but you have to understand the rest of it if you want our help to be useful.
-
May 22nd, 2007, 03:23 PM
#18
Lively Member
Re: Importent Error...
Yeah i know, i've been in that spot before, but i've always had a lot of help from people on here which is why i respect the forums that much more
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
|