Forum: สอบถามปัญหา Notes ทางด้านพัฒนาโปรแกรม (Note Client) |
Tags1: IBM Lotus Domino/Notes| Created on Feb 20, 2008, 9:50 AM by fibkids/9Notes|Topic Responses: 9 |
&action=openDocument&documentId=AB6 |
พี่ค่ะจากที่ทำ ถ้าจะให้ค้นวันที่ หนูได้การใส่ค่าใน dateTime แล้วค่าที่ออกมา มันก็จะออกเอกสารมาทั้งหมด ตั้งแต่วันที่เลือก ถึง ปัจจุบัน อย่างเช่น ใส่วันที่ 16 ก็จะออกมาวันที่ 16,17 ด้วยนะค่ะ ต้องกำหนดตรงไหนเพื่อให้ออกแค่วันที่ 16 ค่ะ ขอบคุณค่ะ
Sub Click(Source As Button)
Dim ws As New NotesUIWorkspace
Dim ss As New NotesSession
Dim db As NotesDatabase
Dim uidoc As NotesUIDocument
Dim dateTime As NotesDateTime
Dim dc As NotesDocumentCollection
Dim vw As NotesView
Dim searchStr As String
Dim DateStr As String
Dim DateVar As Variant
Dim c As Integer
Set db = ss.CurrentDatabase
Set uidoc = ws.CurrentDocument 'Current UI doc to get field value
Set doc = uidoc.Document 'Backend doc to get from ui doc
' เริ่มรับค่าและแปลงค่า
DateVar = doc.GetItemValue("DateSearch")
DateStr = Cstr(DateVar(0))
Set dateTime = New NotesDateTime(DateStr)
Call dateTime.AdjustDay(-1)
Set vw = db.GetView("SearchFolder")
searchStr = {Form='DR' & @Contains(} + doc.ListRev(0) +_
{;'}+ doc.keyword(0) + {' ) }
Set dc = db.Search(searchStr,dateTime,0)
c = dc.Count
Call uidoc.FieldSetText("c", Cstr(c))
Call dc.PutAllInFolder("SearchFolder")
Call vw.Refresh
Call uidoc.Refresh
End Sub |
|