Access: Set focus cursor after character in a text box (1 Viewer)

akika

Registered User.
Local time
Today, 04:33
Joined
Aug 7, 2018
Messages
102
Hi,

I have a text box "txt_name" in access16, with input mask as
"AB "0000a;0

How can i set the cursor to start after AB <Space> for the textbox "txt_name".
 

isladogs

MVP / VIP
Local time
Today, 11:33
Joined
Jan 14, 2017
Messages
18,186
Access options...client settings. Set behaviour entering field value to End of Field.
However this change will apply to all controls throughout your database.
 

akika

Registered User.
Local time
Today, 04:33
Joined
Aug 7, 2018
Messages
102
is there a way to do it via vba codes?
instead of changing the access settings.

the text box value going to be like
"AB |1234"

cursor should be at the pipe when to input the values.
 

missinglinq

AWF VIP
Local time
Today, 07:33
Joined
Jun 20, 2003
Messages
6,423
See if this suits your needs:

Code:
Private Sub txt_Name_Click()
  Me.txt_Name.SelStart = 3
End Sub

Private Sub txt_Name_Enter()
 Me.txt_Name.SelStart = 3
End Sub

Linq ;0)>
 

Users who are viewing this thread

Top Bottom