Forum: สอบถามปัญหา Notes ทางด้านพัฒนาโปรแกรม (Note Client) |
Tags1: | Created on Feb 20, 2008, 2:03 PM by 9notes/9Notes|Topic Responses: 9 |
&action=openDocument&documentId=ABA |
ลองดูตัวอย่างอีกอันครับ แบบย่อหน่อย อันนี้น่าจะเข้าใจง่ายขึ้นครับ
If Not (SDocType = "") Then
If SDocType = "เอกสารรับ" Then
TmpDocType$ = "Form = ""ReceiveForm"""
Else
TmpDocType$ = "Form = ""SendForm"""
End If
End If
If SDocDate = "" Then
TmpDocDate$ = "@Matches(DocDate; " + """" + "*" + """" + ")"
Else
TmpDocDate$ = "DocDate = @TextToTime(" + """" + SDocDate + """" + ")"
End If
If SDocType = "เอกสารรับ" Then
If SSRDate = "" Then
TmpSRDate$ = "@Matches(ReceiveDate; " + """" + "*" + """" + ")"
Else
TmpSRDate$ = "ReceiveDate = @TextToTime(" + """" + SSRDate + """" + ")"
End If
Else
TmpSRDate$ = "SendDate = @TextToTime(" + """" + SSRDate + """" + ")"
End If
SearchFormula$ = TmpDocType$ + TmpDocDate$ + "&" + TmpSRDate$
Set collection = db.Search(SearchFormula$, dateTime, 0 )
For i = 1 To Collection.Count
Set doc = Collection.GetNthDocument( i )
Call doc.PutInFolder( "Search" )
Next
[quote]ตอนที่รับค่ามา ถ้าใช้ GetItemValue ก็ต้องรับค่า มาเป็น Var แล้วแปลงค่า เป็น
สตริงนะค่ะ
แล้วพอเอาไป Format ค่า มันส่งไปยังไงค่ะ เหมือนมันรับค่าไม่ได้นะค่ะ
หรือ ต้องทำการรับค่าเป็นอย่างอื่นค่ะ
Set From_datetime = New NotesDateTime(DateStr)
ทำไมค่านี้มันเซ็ตค่าไม่ได้ค่ะ มันขึ้น Type mismatch
DateVar = doc.GetItemValue("DateSearch")
DateStr = Cstr(DateVar(0))
DateStr = Format(doc.FromDate(0), "Short Date") &" " &
Format(doc.FromTime(0), "Long Time")
Set From_datetime = New NotesDateTime(DateStr)
[/quote] |
|