NotesDatabase Search condition

2020-04-18 05:03发布

问题:

With this code:

Set col = db.Search("Form=""formname"" & id=212", time, 0)

I explicity give the search function 212 for example, but what if I want to give a variable

dim var as Integer

How would my search look like, beacuse this doesn't work:

Set col = db.Search("Form=""formname"" & id=var", time, 0)

回答1:

Set col = db.Search("Form=""formname"" & id=" + Cstr(val), time, 0)

should work.

Cstr() converts the integer value to a string.