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

InStr function

Status
Not open for further replies.

lespaul

Programmer
Feb 4, 2002
7,083
0
0
US
Pascal,
I'm trying to write a LotusScript that will loop through all the documents and write out SQL statements to the new relational database that will be storing this data. One of the fields in the Notes document allows the user to check multiple fields (Cash, Surety or 10%). If that field (BondType) contains Surety in ANY of the value array, then I need a string set to S otherwise the string should be C.

I've tried:
Code:
If Instr(doc.GetItemValue("BondType"), "Surety") > 0 Then
     sBondType = "S" 
Else
     sBondType = "C"
End If
but that gives me a type mismatch error.

What am I doing wrong?

Thanks!

Les
 
Hi Liz,

Personally, I am wary of giving Script or @Db functions parameters that it has to calculate. I know it should work, but most often it either protests at the compiler level, or just doesn't work.

So I would suggest that you load the doc.GetItemValue("BondType") into a String variable and use that in the Instr call.

Cheers,

Pascal.


I've got nothing to hide, and I'd very much like to keep that away from prying eyes.
 
Thanks, that's what I ended up doing!

finally got all the data transferred and everyone is thrilled!

hope all is well!

les
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top