Avoiding CTRL characters in input fields

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

is there a way to avoid accidental entry of Ctrl characters in various input
fields?
Some times data entry uses Ctrl in place of Shift while inputing data.

Also, if there is a way to query fields that may already have Ctrl characters?

Thanks.
 
There's only a limited number of Ctrl combinations that will actually
generate a character in the field, such as Ctrl+Enter for a Cr/Lf pair. If
you need to block them for a particular control in a form, you could use its
KeyPress (or KeyDown) event, seting the KeyPress/KeyCode argument to zero to
destroy the keystroke. You might want to allow backspace (char 8.) To do
this for all controls on a form, set the form's KeyPreview property to Yes,
and use the form's KeyPress or KeyDown event.

To locate the records that have a carriage return in a field, use this
criteria in a query:
Like "*" & Chr(13) & "*"
 
Back
Top