Results 1 to 18 of 18

Thread: Importent Error...

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2007
    Posts
    1

    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.........

  2. #2

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Importent Error...

    Quote 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?

  4. #4
    PowerPoster
    Join Date
    May 2006
    Location
    Location, location!
    Posts
    2,673

    Re: Importent Error...

    Quote 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.

  5. #5
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951

    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]

  6. #6
    PowerPoster
    Join Date
    May 2006
    Location
    Location, location!
    Posts
    2,673

    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:
    1. 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.

  7. #7
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951

    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]

  8. #8
    PowerPoster
    Join Date
    May 2006
    Location
    Location, location!
    Posts
    2,673

    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.

  9. #9
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Importent Error...

    Quote Originally Posted by Pasvorto
    I didn't know how to check for backspace.
    Backspace is vbKeyBack

  10. #10
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951

    Re: Importent Error...

    danke
    ===================================================
    If your question has been answered, mark the thread as [RESOLVED]

  11. #11
    PowerPoster
    Join Date
    May 2006
    Location
    Location, location!
    Posts
    2,673

    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.

  12. #12
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951

    Re: Importent Error...

    True dat
    ===================================================
    If your question has been answered, mark the thread as [RESOLVED]

  13. #13

  14. #14
    PowerPoster
    Join Date
    May 2006
    Location
    Location, location!
    Posts
    2,673

    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.

  15. #15
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951

    Re: Importent Error...

    And with this sound of desperation..

    plzzzzzzzzzzzzzzzzzz help.........
    ===================================================
    If your question has been answered, mark the thread as [RESOLVED]

  16. #16
    Lively Member ixtrip's Avatar
    Join Date
    Aug 2005
    Posts
    64

    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.

  17. #17
    PowerPoster
    Join Date
    May 2006
    Location
    Location, location!
    Posts
    2,673

    Re: Importent Error...

    Quote 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.

  18. #18
    Lively Member ixtrip's Avatar
    Join Date
    Aug 2005
    Posts
    64

    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
  •  



Click Here to Expand Forum to Full Width