Removing blank spaces

H

hdfixitup

I have two text fields storing part numbers. One stores a stripped number
and the other stores a spaced number. Example: (12345 and 12 34 5). I have a
Search text box that I currently type a stripped number into and the record
is retrieved. I need help on the following:
If a spaced number is entered, I would like to strip all spaces and have it
find the stripped number as if I had typed the stripped number first. can
anyone help me? Thanks in advance.

hdfixitup
 
M

Michel Walsh

Replace( yourString, " ", "" )


should replace the spaces to nothing. That function may not works, in a
query, with older Access versions.


? Replace(" a b ced fg h ", " ", "")
abcedfgh


You can probably use a line like:


Me.TextBoxN.Value = Replace(Me.TextBoxN.Value, " ", "" )


in the after update event of the control TextBoxN.





Hoping it may help,
Vanderghast, Access MVP
 

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