string adds spaces after upsize

detrie

Registered User.
Local time
Today, 17:43
Joined
Feb 9, 2006
Messages
113
Hi All,

I just upsized my mdb to SQL server.
I have a command button that is supposed to concatenate into one field.
It worked fine in my mdb but is adding multiple spaces in my adp...
The result of this string should be ... USQ107
Instead I'm getting ... US Q107
Can anyone see my mistake here?

Dim strCt As Long
Dim strBuild As String
Dim strNewCount As String

strBuild = me.cmbProjectCountry & "Q" & Me.cmbNewQuarter & Right([cmbNewYear], 2)



Thanks
Detrie
 
What happens when you use the following?
strBuild = Trim(me.cmbProjectCountry) & "Q" & Me.cmbNewQuarter & Right([cmbNewYear], 2)
 
Hi Rural....
Thanks for your response
"What happens when I use...strBuild = Trim(me.cmbProjectCountry) & "Q" & Me.cmbNewQuarter & Right([cmbNewYear], 2)"?????

IT WORKS PERFECTLY!!!!! Thank you
Can you tell me why I needed to add "Trim"???

Detrie
 
For some reason your cmbProjectCountry has a trailing space in it. I have no idea where it picked up the space but maybe you can find it.
 

Users who are viewing this thread

Back
Top Bottom