Isolating text in a field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi folks!

The following text is an example:

"F002 Internal Audit Summary Report Form Rev B.doc"

How do I isolate "Rev B" considering that everything that comes before isn't
necessarily the same length in each record.

Cheers!
 
You can use the VBA function InStr( ), see the help file, to spot the
beginning of "Rev B" and then, use Left( ), or Mid( ), to segment the
strings in its parts:




Left( MyField & "Rev B", InStr( MyField & "Rev B" , "Rev B") - 1 )


will give what precedes the first occurrence of Rev B, in your string, or
the whole string, if Rev B is absent.



Hoping it may help,
Vanderghast, Access MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top