Disable/Prevent/Catch Line Breaks in Form fields

TomTomTom

New member
Local time
Today, 23:03
Joined
May 10, 2012
Messages
2
Hi!

I am wondering if and how I can disable line breaks in a form field (text box, date picker, number, etc.). It happens quite often that users copy&paste information from a Word Document or a Website to an Access form field and accidentally paste a line break too. This leads to visual confusion and also to issues regarding some data validation we are doing in the background.

We are using MS Access 2010 SP1.

Thanks for you help!
Best,
Tom
 
Replace(Replace(str, Chr(10), ""), Chr(13), "")

where str is the string you want to process

Chr(13) = Carriage Return
Chr(10) = Line break

Both together is a line break in windows (except Excel cells)

The code will replace them all with nothing
 
Thanks for the quick response, Vila.
I'll give it a try today.

Best,
Tom
 

Users who are viewing this thread

Back
Top Bottom