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!

Extracting Data from a txt box displayed between ( ) & either side o

Status
Not open for further replies.

RenaissanceJo

Technical User
Sep 14, 2000
6
GB
Hi, I have a problem with Access 2K that is driving me to distraction. I
have tried everything from querys to code but I do not think my level of
Access/VB knowledge is good enough to figure this out on my own.

Here's my problem.

I have two text boxes on an imported table, Lets call them [txt1] and
[txt2].

[txt1] displays data in "Short Time format", inclosed in brackets like
(17:35).
I need to be able to extract the data contained between the brackets so it
looks like 17:35 using either a query or code so I can then append the
extracted data to another table.

[txt2] displays two set of data seperated by either a - or a / like
Microsoft - Access 2000 or Microsoft / Access 2000.
I need to be able to extract the data either side of the - or / and append
it to different txt boxes in a new table, again either by code or a query.


Can anyone point me in the right direction please.

Jo [sig][/sig]
 



See the Standard VBA libray function called, "Format()", in the reference. It explains the solution to your problem in depth.
[sig]<p>Amiel<br><a href=mailto:amielzz@netscape.net>amielzz@netscape.net</a><br><a href= > </a><br> [/sig]
 
see my posting in &quot;general&quot; listing!

:cool:

Robert
[sig][/sig]
 
If both boxes are indeed textual, then you can use a combination of the Right, Left and Instr functions to get your data out. Use Instr to determine your position in the string, and use Right() or Left() to grab the data in either direction. It's hokey, but it usually works.
 
dont for get the ever helpful
Code:
mid()
function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top