-
Ok, lets say I have 124125125.21 in text1.text......and I wanted the extension of that, which is 21...to be in label1.caption.....how would i go about doing that?
However the extension will not always remain 21, so basically it has to read after the ., so it will work for other text that is typed in...got me?
-
Try this:
Code:
Dim intPeriodPos As Integer
intPeriodPos = InStr(Text1.Text, ".")
If intPeriodPos > 0 Then
Label1.Caption = Mid$(Text1.Text, intPeriodPos + 1)
End If
-
YEAHHH
Flash Gordon to the rescue!!!! Thanks Gordon, it worked....I had something similiar however it always returned the extension back as .*....but i see what you did, thanks!
-
Elegant Solution
Someone showed me this once. Elegant.
Code:
Label1.Caption = Text1.Text - CInt(Text1.Text)
A little less overhead too.
John