Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / May 2007

Tip: Looking for answers? Try searching our database.

Validate input field to filter out certain characters

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Smiley - 17 May 2007 14:11 GMT
Hi,

I am on MSAccess 2000 and I want to valid a field before going on to next
field when user inputting data.

My so call validation is just change certain input characters into space or
just remove such character.

For example, if user input abcd's or abc@erews, I want the final data look
like either abcds or abcd s for abc@erews will look like abc erews or
abcerews.

Anyone any idea ?
Carl Rapson - 17 May 2007 16:33 GMT
> Hi,
>
[quoted text clipped - 9 lines]
>
> Anyone any idea ?

Use the KeyPress event to filter out any characters that are not allowed.
Alternatively, you could use the AfterUpdate event to scan the entire string
and replace/remove the characters you don't want.

Carl Rapson
Smiley - 18 May 2007 21:16 GMT
Hi Carl,

Thank you.

>> Hi,
>>
[quoted text clipped - 15 lines]
>
> Carl Rapson
missinglinq - 18 May 2007 22:22 GMT
This code prevents certain characters from being entered. In this case, it's
A and B, but you can replace the 65 and 66 with the ASCII code for any
character you wish.

Private SubYourTextBoxName_KeyDown(KeyCode As Integer, Shift As Integer)
 
  Select Case KeyCode

    Case 65, 66
       KeyCode = 0
 
  End Select

End Sub

Signature

There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.