我有一个表单(TrimQuery),它有 2 个可编辑的日期选择器字段(Start_Date 和 End_Date)和一个按钮。按一下按钮,我需要从另一个表单(Trim Track)中调出一个预先存在的视图(All Trim Tracking),该表单轮询字段(Trim_Date)并显示我在(TrimQuery)表单中指定的日期之间的所有文档使用日期选择器。我已经发布了下面的代码。
是否有另一种方法可以查看两个日期之间的文档?我认为我的大部分问题在于选择公式,我已经发布了代码,但我知道它是不正确的。我试图从其他示例中获取一些代码。请把这个分开。我感谢我能得到的任何帮助。谢谢。
Sub Click(Source As Button)
Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim workspace As NotesUIWorkspace
Dim doc As NotesDocument
Dim uidoc As NotesUIDocument
Dim StartDate As NotesItem
Dim EndDate As NotesItem
Dim Trimming As String
Trimming = "Trim Track"
Set StartDate = doc.GetFirstItem("Start_Date")
Set EndDate = doc.GetFirstItem("End_Date")
Set uidoc=workspace.CurrentDocument
Set db=session.CurrentDatabase
Set view=db.GetView("All Trim Tracking")
SF = {SELECT Trim_Date = "} & StartDate.Text & "&" & EndDate.Text & {" | (Form = }& Trimming & {")} <==I realize this is incorrect, I don't know the correct formula.
If StartDate.Text <> "" And EndDate.Text <> "" Then
view.SelectionFormula = SF
Else
view.SelectionFormula="select @all"
End If
End Sub