VBA's Trim() function, unlike XL's TRIM(), doesn't remove internal
spaces. Is that's what's not working?

You could try:

UsrName = Application.Trim(.TbUsrName)



In article <uNnVqNwWFHA.2288@TK2MSFTNGP14.phx.gbl>,
"Stuart" <sgbooth@totalise.co.uk> wrote:

> Might be useful if I mentioned the required end result(g),
> namely to remove leading, trailing and intermediate spaces from the string.