I
Ig
Hi
I have field with mask \(000") "000\-0000;0;" " - telephone number.
I want when user first time clicks this field it will get default area code
and cursor would stay on the first next empty place:
(205)___-____
^
The following code positions cursor well:
Private Sub txtHomePhone_Click()
If Nz(Me!txtHomePhone, "") = "" Then
Me!txtHomePhone.SelStart = 4
Me!txtHomePhone.SelLength = 1
End If
End Sub
But when I add area code, then it selects all field and not stays as it
needed.
Private Sub txtHomePhone_Click()
If Nz(Me!txtHomePhone, "") = "" Then
Me!txtHomePhone = "205"
Me!txtHomePhone.SelStart = 4
Me!txtHomePhone.SelLength = 1
End If
End Sub
Thanks
I have field with mask \(000") "000\-0000;0;" " - telephone number.
I want when user first time clicks this field it will get default area code
and cursor would stay on the first next empty place:
(205)___-____
^
The following code positions cursor well:
Private Sub txtHomePhone_Click()
If Nz(Me!txtHomePhone, "") = "" Then
Me!txtHomePhone.SelStart = 4
Me!txtHomePhone.SelLength = 1
End If
End Sub
But when I add area code, then it selects all field and not stays as it
needed.
Private Sub txtHomePhone_Click()
If Nz(Me!txtHomePhone, "") = "" Then
Me!txtHomePhone = "205"
Me!txtHomePhone.SelStart = 4
Me!txtHomePhone.SelLength = 1
End If
End Sub
Thanks