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

Retrieve data

Status
Not open for further replies.

Ielamrani

MIS
Jul 7, 2005
183
0
0
US
Hi,
I have a text box with the following data:

contract type: Group (Global IPA)
contract type: Group (UPA)
contract type: Group (QLIMG)
contract type: Group (Atlantic)

I would like to retrieve only the following:

Global IPA
UPA
QLIMG
Atlantic

Is it possible.
Thanks
Ismail
 
How are ya Ielamrani . . .

Try this function:
Code:
[blue]Public Function ConTyp(str As String)
   Dim idx As Integer
   
   idx = InStr(1, str, "(")
   ConTyp = Mid(str, idx + 1, Len(str) - idx -1)
   
End Function[/blue]

Calvin.gif
See Ya! . . . . . .
 
Another way:
retrievedValue = Mid(Left([TextBox], InStr([TextBox], ")") - 1), 1 + InStr([TextBox], "("))

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top