Unanswered: Add blank space at end of text box string
With an Access 2003 form, I am using the keypress event in a text box to enter sentences, and I allow the character if it matches a predetermined letter. It is a text memorization game.
When a non-letter character, such as space or punctuation follows, the program provides that character and the player will only have to type in letters.
I have found that when I try to add a space to the text box string of text, it does not take. If I assign the value "The " to the text box, the last character in the text box is "e" when I want it to be a space, and testing in VB shows the length of the text box text is 3.
I have tried these:
Me.txtBox.Text = Me.txtBox.Text & " "
Me.txtBox.Text = Me.txtBox.Text & Chr(32)
Not sure why it's trimming the value for you, but Access will probably let a non-breaking space through. That's Chr$(160) in the normal Latin-1 character set that Windows uses. Just be sure to convert them back to regular spaces when you do something with them.