title: Search for multiple strings in a field
body: <p>I have to search for some strings in a field and perform computations.</p>
  
  <p>For example, I have this field 100KSGD,</p>
  
  <p>I have to get K, then multiply the value of 100 to 1000, so Ill get 100,000SGD.</p>
  
  <p>Next is, I have to get SGD and multiply it with the foreign exchange rate of SGD to USD. That's the value that I have to get.</p>
  
  <p>I used Instr to get K and I was able to perform calculations if there is no other string in the field. </p>
  
  <p>Here is my code for that:</p>
  
  <pre><code>    If InStr(1 , OEMTEST_String$ , HasString_K$, 5) &gt; 0 Then
              Print "Searching for letter K in OEMTEST field..."
              MsgBox("Letter K is found in OEMTEST field!")
              Print "Converting OEMTEST field..."
  
          'Replace  All occurrences of K  
          tempPosition = InStr( 1, OEMTEST_String$, HasString_K$ )    
          If( ( Len( OEMTEST_String$ ) - Len( HasString_K$ ) ) + 1 = tempPosition ) Then 
              OEMnvar = Left( OEMTEST_String$, tempPosition - 1 )
              MsgBox "The number value in OEMTEST field is " &amp; OEMnvar
  
              OEMnewvar = CDbl(OEMnvar) 'change nvar from string to double
              OEMupdatedVar = CDbl(OEMnewvar * 1000) 'multiply the value by 1000
  
              MsgBox "new value of OEMTEST is " &amp; OEMupdatedvar 'check message box
  
              'replace the value and save the document
              Print "Saving converted value of OEMTEST field..."
              Call note.ReplaceItemValue("OEMTEST", OEMupdatedVar)
              Call note.Save(True, False) 
  
          End If
          Else
          Print "Letter K not found in OEMTEST field..."
      End If
  </code></pre>
  
  <p>How can I get to the value that I need? How do I do a nested Instr?</p>
  
  <p>THANK YOU VERY MUCH!</p>