While you may have fixed this using a TextBox I suspect the real problem is in the registry code and you can get rid of the TextBox:
Code:
   sBuffer = Trim(sBuffer)
   GetStringValue = Left(sBuffer, Len(sBuffer) - 1) 'return the value to the user
You should NOT be using Trim here. Try this:

Code:
GetStringValue = StripNull(sBuffer)

Public Function StripNull(StrIn As String) As String
   Dim nul              As Long
   nul = InStr(StrIn, vbNullChar)
   If (nul) Then
      StripNull = Left$(StrIn, nul - 1)
   Else
      StripNull = Trim$(StrIn)
   End If
End Function