Remove spaces within a string

G

Guest

I have a number of bound and unbound text boxes on the various forms in my
database. And I want to prevent the user entering spaces (not just leading
and trailing).

Is there a function I can use to detect spaces within a string and remove
them?


Thanks,
Seth
 
A

Allen Browne

Use the KeyPress event of the control (or the Form to affect all controls).

If the KeyCode = 32, destroy the keystroke by setting it to zero.

For existing data in Access 2000 and later, use the Replace() function.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top