|
以下是我在“项目名称”按钮的单击事件,我想实现单击这个按钮后打开指定窗体,条件是打开的窗体和“项目名称”按钮所在窗体上看到“项目名称”和“申请时间”的数值都相同的记录,可是总是提示错误!!!怎么解决啊,帮忙!!!
Private Sub 项目名称_Click()
Dim stDocName As String
Dim stLinkCriteria0 As String
Dim stLinkCriteria1 As String
Dim stLinkCriteria2 As String
Dim SQL as string
stDocName = "许可明细查询"
stLinkCriteria0 = "[项目名称]=" & "'" & Me![项目名称] & "'"
stLinkCriteria1 = "[申请时间]=" & "'" & Me![申请时间] & "'"
SQL = stLinkCriteria0 & " and " & stLinkCriteria1
DoCmd.OpenForm stDocName, , , SQL,..
End Sub
如果是单个查询就没问题,以下是单个查询的代码:
Private Sub 项目名称_Click()
Dim stDocName As String
Dim stLinkCriteria0 As String
Dim stLinkCriteria1 As String
Dim stLinkCriteria2 As String
Dim SQL as string
stDocName = "许可明细查询"
stLinkCriteria0 = "[项目名称]=" & "'" & Me![项目名称] & "'"
stLinkCriteria1 = "[申请时间]=" & "'" & Me![申请时间] & "'"
SQL = stLinkCriteria0
DoCmd.OpenForm stDocName, , , SQL
End Sub
[ 本帖最后由 tsweiwei 于 2009-1-8 21:56 编辑 ] |
|