Selasa, 17 Januari 2017

Re: [MS_AccessPros] input mask to prevent punctuation characters

 

I would think an Input Mask (as long as all you allow are letters and numbers) like this would work:


Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

That's a letter or number required in the first character and optionally a letter or number (but nothing else) in the other 49 spaces.

John Viescas, Author
Effective SQL
SQL Queries for Mere Mortals 
Microsoft Access 2010 Inside Out
Microsoft Access 2007 Inside Out
Microsoft Access 2003 Inside Out
Building Microsoft Access Applications 
(Paris, France)




On Jan 17, 2017, at 9:40 AM, Duane Hookom duanehookom@hotmail.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> wrote:



I would add some code that intercepts the keystrokes in the text box using the KeyPress event:

Private Sub Text0_KeyPress(KeyAscii As Integer)
    Dim strProhibitedCharacters As String
    strProhibitedCharacters = "'?)(/&%ç*+;,:._-!" & Chr(34)
    If InStr(1, strProhibitedCharacters, Chr(KeyAscii)) > 0 Then
        KeyAscii = 0
    End If
End Sub

Regards,
Duane



From: MS_Access_Professionals@yahoogroups.com <MS_Access_Professionals@yahoogroups.com> on behalf of david.pratt@outlook.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com>
Sent: Monday, January 16, 2017 5:45 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] input mask to prevent punctuation characters
 


I have a text field (max 50 characters) that I wish to prevent the use of any punctuation characters in.  I can't figure out how to set the input mask with a field this large.

Thank you.






__._,_.___

Posted by: John Viescas <johnv@msn.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (3)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


.

__,_._,___

Tidak ada komentar:

Posting Komentar