Eliminating Spaces in Data Entered

shewolf

Registered User.
Local time
Today, 11:46
Joined
Dec 3, 2004
Messages
25
I have a field in a database that needs the data entered without any spaces and I'm trying to figure out how to set either the validation rules or the masks so that the system will either automatically delete any spaces or warn the user not to enter them.

My preference would be for them to automatically be deleted.

Any ideas, suggestions?

I can figure out how to make either all numbers or all letters, but the data is both so that doesn't work.

Thanks, in advance, for your help.

Charis
 
Look into the TRIM function as a way to massage your data after-the-fact with an Update query, perhaps.

Also watch out for double-posting on the same subject. If your browser is even slightly whacko, you post the same message twice - particularly if you double-click something that only requires a single click. When you check back on your post, if you see a double, edit the second one and delete it. Makes for less clutter and gives you fewer places to look for your responses.
 
Working at form level you can correct their data entry with the replace function

Sub MyField_AfterUpdate()
Me.MyField = Replace(Me.MyField, " ", "")
End Sub

HTH

Peter
 
Thanks Peter

I think that might just be the ticket.
 
Or, in the KeyPress event:

Code:
If KeyAscii = 32 Then KeyAscii = 0
 

Users who are viewing this thread

Back
Top Bottom