Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Damm Text boxes 97

Status
Not open for further replies.

Chance1234

IS-IT--Management
Jul 25, 2001
7,871
US
biggest oxymoron of all time "Microsoft Works" :)


Anyway, i have a textbox in a form in Access 97 and i need to protext the first 26 characters in that text box(prefix) All the usual methods such as attaching a string to the begiining of the field after update or default value in field I cant use due to the complexity of this database

Im sure there is some method under the key press event where you can return the position inside a text box

so the code would be something like

If PositionIntextbox <26 then
positionIntextbox = 27
end if

but have a feeling im thinking of a totally different language to VB

anyone got any ideas ?

Chance


 
See if you can make this work.


Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If TextBox1.SelStart <= 26 Then TextBox1.SelStart = 27
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top