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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting part of number/ text in textbox

Status
Not open for further replies.

caman74

IS-IT--Management
Jan 1, 2005
67
NO
Hello everybody.

I have a form "frmForm" with two textboxes, "txtText1" and "txtText2".
In "txtText1" I insert nubers varying on lenght from 2-8 digits.
I need "txtText2" to automaticly show the first two digits from "txtText1".

How do I do this. Preferable in VBA.

Thanx.

Chris
 
The Control Source property of txtText2:
=Left([txtText1],2)
 
How are ya caman74 . . .

If [blue]txtText2[/blue] id bound, put [blue]Lilliabeth's[/blue] code above in the [blue]AfterUpdate[/blue] event of [blue]txtText1[/blue].

Calvin.gif
See Ya! . . . . . .
 
Thank you both!

Some things are way too easy...
 
Woooa . . . Scratch my previous post . . .

If [blue]txtText2[/blue] is bound, in the [blue]AfterUpdate[/blue] event of [blue]txtText1[/blue]:
Code:
[blue]   Me!txtText2 = Left(Me!txtText1,2)[/blue]

Calvin.gif
See Ya! . . . . . .
 
AceMan...
Thanx but I used;

Me!txtText2 = Left([txtText1,2) ,and it works perfectly.
 
New error follows...

Me!txtText2 = Left([txtText1],2) ,and it works perfectly.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top