过滤访问权限 [英] Filtering with access
问题描述
每一个人
我是新手,我的问题是:
我试图通过使用cambo box和Comand来过滤报告bottons,组合框设置过滤值bottens for close,clear和apply filter to report.always getting type mismatch runtime error 13 when i debug error it hi light this
strSQL = strSQL& " [" &安培; Me(Filter& intCounter).Tag& , _
& " = &安培; Chr(34)&我(过滤器& intCounter)& Chr(34)& "" _
和"
这是该代码的一部分
Private Sub Set_Filter_Click()
Dim strSQL As String,intCounter As Integer
''构建SQL字符串。
对于intCounter = 1到3
如果我(过滤器& intCounter)<> ""然后
strSQL = strSQL& " [" &安培; Me(Filter& intCounter).Tag& , _
& " = &安培; Chr(34)&我(过滤器& intCounter)& Chr(34)& "" _
和"
结束如果
下一页
如果是strSQL<> ; ""然后
''剥离最后一次'并且。
strSQL = Left(strSQL,(Len(strSQL) - 3))
''设置Filter属性。
报告![rptTransactions] .Filter = strSQL
报告![rptTransactions] .FilterOn = True
结束如果
End Sub
可以帮助我修复这个问题吗?!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!! ..
Hi Every One
I am New to the discoution, My problem is:
I am trying to filter a report by using cambo box and Comand bottons, Combo Box to set the filter value bottens for close,clear and apply filter to report.always getting type mismatch runtime error 13 when i debug error it hi light this line
strSQL = strSQL & "[" & Me("Filter" & intCounter).Tag & "] " _
& " = " & Chr(34) & Me("Filter" & intCounter) & Chr(34) & "" _
And ""
Which it is part of this code
Private Sub Set_Filter_Click()
Dim strSQL As String, intCounter As Integer
'' Build SQL String.
For intCounter = 1 To 3
If Me("Filter" & intCounter) <> "" Then
strSQL = strSQL & "[" & Me("Filter" & intCounter).Tag & "] " _
& " = " & Chr(34) & Me("Filter" & intCounter) & Chr(34) & "" _
And ""
End If
Next
If strSQL <> "" Then
'' Strip Last " And ".
strSQL = Left(strSQL, (Len(strSQL) - 3))
'' Set the Filter property.
Reports![rptTransactions].Filter = strSQL
Reports![rptTransactions].FilterOn = True
End If
End Sub
Can Some 1 help me fix this problem?!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!..
推荐答案
嗨每一个
我是新手,我的问题是:
我试图通过使用cambo box和Comand bottons过滤报告,Combo Box设置过滤器值为bottens for关闭,清除并应用过滤器来报告。当我调试错误时,它会得到类型不匹配的运行时错误13点亮此行
strSQL = strSQL& " [" &安培; Me(Filter& intCounter).Tag& , _
& " = &安培; Chr(34)&我(过滤器& intCounter)& Chr(34)& "" _
和"
这是该代码的一部分
Private Sub Set_Filter_Click()
Dim strSQL As String,intCounter As Integer
''构建SQL字符串。
对于intCounter = 1到3
如果我(过滤器& intCounter)<> ""然后
strSQL = strSQL& " [" &安培; Me(Filter& intCounter).Tag& , _
& " = &安培; Chr(34)&我(过滤器& intCounter)& Chr(34)& "" _
和"
结束如果
下一页
如果是strSQL<> ; ""然后
''剥离最后一次'并且。
strSQL = Left(strSQL,(Len(strSQL) - 3))
''设置Filter属性。
报告![rptTransactions] .Filter = strSQL
报告![rptTransactions] .FilterOn = True
结束如果
End Sub
可以帮助我修复这个问题吗?!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!! ..
Hi Every One
I am New to the discoution, My problem is:
I am trying to filter a report by using cambo box and Comand bottons, Combo Box to set the filter value bottens for close,clear and apply filter to report.always getting type mismatch runtime error 13 when i debug error it hi light this line
strSQL = strSQL & "[" & Me("Filter" & intCounter).Tag & "] " _
& " = " & Chr(34) & Me("Filter" & intCounter) & Chr(34) & "" _
And ""
Which it is part of this code
Private Sub Set_Filter_Click()
Dim strSQL As String, intCounter As Integer
'' Build SQL String.
For intCounter = 1 To 3
If Me("Filter" & intCounter) <> "" Then
strSQL = strSQL & "[" & Me("Filter" & intCounter).Tag & "] " _
& " = " & Chr(34) & Me("Filter" & intCounter) & Chr(34) & "" _
And ""
End If
Next
If strSQL <> "" Then
'' Strip Last " And ".
strSQL = Left(strSQL, (Len(strSQL) - 3))
'' Set the Filter property.
Reports![rptTransactions].Filter = strSQL
Reports![rptTransactions].FilterOn = True
End If
End Sub
Can Some 1 help me fix this problem?!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!..
Hey Iyhamid,欢迎来到剧本。我要把它移到SQL论坛。祝你有愉快的一天。
Hey Iyhamid, Welcome to theScripts. im going to move this to the SQL forum. Have a nice day.
大家好,
我认为线程在访问论坛中可能会更开心。
>
问候紫色
Hi All,
I think the thread may be happier in the access forum.
Regards Purple
早上好lyhamid,
首先,您使用的是什么版本的程序?
其次,您希望从此strSQL语句中看到什么输出?
即[Filter1] =" Filter1"或类似的东西?
问候,
Scott
Good morning lyhamid,
First of all, what version of what program are you using?
Second, what is the output you would like to see from this strSQL statement?
i.e. [Filter1] = "Filter1" or something like that?
Regards,
Scott
这篇关于过滤访问权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!