Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to get rid of the spaces in the string

Status
Not open for further replies.

sabavno

Programmer
Jul 25, 2002
381
CA
Hi

I have list populated with the names. When I run sql to find a row, I can't match the value entered in the parameter with the value in the list box.

Here is what happens.

I let the user to enter the name into the input box. User enters "McKay", then I look for "McKay" in my listbox. But McKay value in the list box has spaces appended(E.g. "McKay ") So I can't locate the row.

Can I get rid of spaces or what else could I do to solve this problem

Thanks
 
Use the trim function : Trim$(str). This will remove any leading and trailing spaces.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top