View Single Post
  #3 (permalink)  
Old June 9th, 2003, 11:37 AM
SerranoG SerranoG is offline
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG

quote:Originally posted by Kenny Alligood
 I am attempting to cancel a keystroke thru code and am not having any luck. I have a textbox on a form that I want to limit to 30 characters. I have the field in the underlying table set to a max of 30 but I want to warn the user that the maxinum has been exceeded (at 31 characters) and activate the backspace key (KeyAscii(8)).
 I don't understand why you need to code this. If the field is limited to 30 characters then when the user tries to type the 31st character, Access will just not type it. The user then knows that the limit has been reached. Because the 31st character will not be even allowed to be typed, there is no need to activate a backspace. Doing so will erase the 30th character. You don't want that.

Unless I misunderstand your intention it sounds like you're creating more work for yourself. Let Access function by default in this case.

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
Reply With Quote