我在搜索参数中获取以下代码中的错误。我不知道如何将参数设置为变量
Dim session As New NotesSession
Dim db As NotesDatabase
Set db = session.CurrentDatabase
Dim trenutni_dokument As NotesDocument
Dim ws As New NotesUIWorkspace
Dim broj As Integer
Set trenutni_dokument = ws.CurrentDocument.Document
broj = trenutni_dokument.serijski_broj_ukidanja
Call trenutni_dokument.Save(True, False)
Dim stari As NotesDocument
Dim skup As NotesDocumentCollection
Set skup = db.Search("Form=""certifikat"" & serijski_broj=" +Cstr(broj) , Nothing, 0)
Set stari = skup.GetFirstDocument
stari.stanje="Aktivan"
Call stari.Save(True, False)
'Dim dateTime As New NotesDateTime( "" )
'dateTime.LSLocalTime = Now
'stari.GetFirstDocument.datum = dateTime.DateOnly
'Call stari.GetFirstDocument.Save(True, False)
答案 0 :(得分:0)
尝试以下方法:
Set skup = db.Search({Form="certifikat" & serijski_broj="} & broj &{"}, Nothing, 0)
这会将当前文档的项目broj的值添加到搜索字符串中。我使用{}作为字符串分隔符来使代码更具可读性...我个人不喜欢通过复制掩盖特殊字符,我认为它使代码难以阅读。