data input going in backwards

G

Guest

I'm attempting to create a form that will allow users to input data without
using a keyboard (touchscreen). I have a text box (lastname) and large
command buttons of A-Z. I have coded the command button to update the data
currently in the lastname field with the button that is clicked
(lastname.text="a" + lastname.text) problem is that the button that is
clicked adds that letter to the start of the text instead of the end. So if
you typed in CHRIS it shows up in the textbox as SIRHC. I have edited the
calculation to be lastname.text=lastname.text+"a" and it still doesn't work.

Can anyone suggest a fix for this ?

Thanks
Chris
 
G

Guest

It it doing exactly what you are telling it to do.
(lastname.text="a" + lastname.text)
You are putting the new character on the front of the current string. In
addition, you should always use & instead of + when concatenating strings. +
is a math operator. Also, I am not sure how the .text property is even
working, That is for VB. In VBA, you use either .value or nothing. .value
is the default property when addressing a text box. Here it the correct
version:
Me.lastname = Me.lastname & "a"
 
G

Guest

perfect....thank you very much for the help !


Klatuu said:
It it doing exactly what you are telling it to do.
(lastname.text="a" + lastname.text)
You are putting the new character on the front of the current string. In
addition, you should always use & instead of + when concatenating strings. +
is a math operator. Also, I am not sure how the .text property is even
working, That is for VB. In VBA, you use either .value or nothing. .value
is the default property when addressing a text box. Here it the correct
version:
Me.lastname = Me.lastname & "a"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top