Re: checking for correct Chr in string
- From: "atlantis43 via AccessMonster.com" <u24690@uwe>
- Date: Sun, 03 Sep 2006 02:17:23 GMT
Piet;Thanks for reply, which seems to be just what I seek. Only problem I
have is: how do I call this sub?
I'm entering "Text0KeyPress in my keypress event for my cbo, but I'm getting
errmsg "sub or function not defined. (with or without the parenteses). What
am I missing?
TIA, Richard
pietlinden@xxxxxxxxxxx wrote:
I have a cbo in which are entered surname,prename;Date of birth. It is[quoted text clipped - 6 lines]
important that the comma be a comma, and that the semicolon be a semicolon.
--
Message posted via http://www.accessmonster.com
This is a mutant, but it's a test/example. If you trap the key pressed
in the KeyPress event of your control, you can reject/discard the
characters you don't want in your control. The following code rejects
the semi-colon, period, and colon.
Private Sub Text0_KeyPress(KeyAscii As Integer)
'---Use this if you want to the code to respond differently to
different keys
' Select Case KeyAscii
' Case 46 'period
' KeyAscii = 0
' Case 58 'colon, I think...
' KeyAscii = 0
' Case 59 'semi-colon
' KeyAscii = 0
' Case Else 'do nothing
' End Select
'---or this one if you just want to throw away/ignore a fixed set of
keys.
Select Case KeyAscii
Case 58, 46, 59 '---list of the asc(":") values that you want
to reject
KeyAscii = 0
Case Else 'do nothing
End Select
End Sub
yes, it's a screwy example. You'd use one or the other....
--
Message posted via http://www.accessmonster.com
.
- Follow-Ups:
- Re: checking for correct Chr in string
- From: pietlinden
- Re: checking for correct Chr in string
- References:
- checking for correct Chr in string
- From: atlantis43 via AccessMonster.com
- Re: checking for correct Chr in string
- From: pietlinden
- checking for correct Chr in string
- Prev by Date: Re: checking for correct Chr in string
- Next by Date: Variables from Table
- Previous by thread: Re: checking for correct Chr in string
- Next by thread: Re: checking for correct Chr in string
- Index(es):
Relevant Pages
|