Unwanted Space in string

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

My result adds a space between strVendor and intCase. Can anyone tell me
why there is a space and how to remove it?

Here is my code:

Dim intCase As Integer
Dim stVendor As String
Dim stCaseNo As String

If Not IsNull(Me.txtPmID) Then

intCase = Me.txtPostmortemID + 10000

If Me.Vendor = "who" Then
stVendor = "ABC"
ElseIf Me.Vendor = "What" Then
stVendor = "DEF"
ElseIf Me.Vendor = "Where" Then
stVendor = "GHI"
End If

Me.txtCaseNo.Value = stVendor + Str(intCase)

End If

Thanks,
 
Thank you!

Klatuu said:
Use the Cstr instead of the STr function. Also, use tht & for string
concatenation. The + is a math operator.

Me.txtCaseNo.Value = stVendor & CStr(intCase)
 
Back
Top