Connecting two strings adds an unwanted space

I have a script that prompts the user for a Group name. After which I append a group number to the name. I thought I should get “TestGroup1” but am getting “TestGroup 1”. What am I doing wrong? There are probably several ways to do this so let me know how to correct it or approach it in a different way. Thanks in advance!!

CODE:

'prompt user for Group name

Dim strOrigGroupString As String

Dim strtmpGroupString As String

'counter used to keep track of the number of groups processed

Dim groupCntr As Integer

groupCntr = 1

strOrigGroupString = Inputbox(Me.m_GroupHelperStringTable.GetString(6,Null),_

Me.m_GroupHelperStringTable.GetString(7,Null),_

Me.m_GroupHelperStringTable.GetString(8,Null))

'append the groupCntr to the group name

strtmpGroupString = strOrigGroupString + Str$(groupCntr)

Subject: connecting two strings adds an unwanted space

The Str$() function puts a space in front of the string if positive numbeer, else places a - sign there. Use the CStr() function instead. --Ron

Subject: connecting two strings adds an unwanted space

Try using CStr instead of Str$ - that seems to be forcing the extra space.

strtmpGroupString = strOrigGroupString + CStr(groupCntr)

Subject: RE: connecting two strings adds an unwanted space

Thanks Ron and Esther!!! Worked great!!!(Thanks Esther for helping me on both my questions!)