-
Text box problem
Hi
I have a text box that changes a < to another symbol, using the Replace statement:
Me.Text1 = Replace(Text1, "<", "§")
However, when its run, it does what its supposed to do, but the cursor, jumps to the start of the text box. How do I stop this.
Some1 told me to use SelStart or something similar, but I cant work out how!
Any help would be appreciated.
-
Reply
here u go m8 u were almost there
'//code
Me.Text1 = Replace(Text1, "<", "§")
'Starts at the end of the textbox
Text1.SelStart = Len(Text1.text)
'//End of code
-
To have the cursor stay where it was try:
Code:
i = instr(Text1.Text,"<")
Replace(Text1.Text,"<","§")
Text1.SelStart = i
-
thanks guys / gals (Just to be sure) :)