报告视图(动态视图) [英] Report View (Dynamic View)
本文介绍了报告视图(动态视图)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个调用并生成动态报告的表单
在该表单中我有一个文本框和一个命令按钮
在我的文本框我输入一个ID格式如下(''POC-00001'')
然后我点击命令按钮预览那个特定id的
报告然后打印报告
但问题是,如果我在文本框中输入另一个ID,如(''POC-00002'')
并单击命令按钮
报告显示仍然是POC-00001报告
任何人都可以帮助我完成我的剧本
这是我的代码
I have a form that calls and generate a dynamic report
In that form i have a textbox and a commandbutton
In my textbox i enter an ID Formatted like this (''POC-00001'')
and then i click the command button to preview the
report of that certain id and then print the report
But the problem is if i enter another id in my textbox like (''POC-00002'')
and click the command button
the report show and still the POC-00001 report
Can anybody help me for my script
This is my code
展开 | 选择 | Wrap | 行号
推荐答案
您使用过滤器而不是where条件打开报告。只需在限制之前添加另一个逗号,它应该可以正常工作。
You were opening the report with a filter instead of a where condition. Just add another comma before the limit and it should work fine.
展开 | 选择 | Wrap | 行号
Ok MAry il尝试谢谢
Ok MAry il try for that thanks
我现在添加一个逗号
私有子cmdopenreport_Click()
错误GoTo Err_cmdopenreport_Click
Dim limit As String
limit =" id =" &安培; InputPCnum.Value
Dim stDocName As String
stDocName =" jointable"
DoCmd.OpenReport stDocName,acPreview ,, limit
Exit_cmdopenreport_Click:
退出Sub
Err_cmdopenreport_Click:
MsgBox Err.Description
恢复退出_cmdopenreport_Click
结束子
但是每当我输入某个ID时,弹出一个表格说 ;输入参数值如果我输入任何数值,我的报告视图将显示,但没有数据,我的意思是它的空白报告......
i add a comma now
Private Sub cmdopenreport_Click()
On Error GoTo Err_cmdopenreport_Click
Dim limit As String
limit = "id = " & InputPCnum.Value
Dim stDocName As String
stDocName = "jointable"
DoCmd.OpenReport stDocName, acPreview, , limit
Exit_cmdopenreport_Click:
Exit Sub
Err_cmdopenreport_Click:
MsgBox Err.Description
Resume Exit_cmdopenreport_Click
End Sub
but everytime i input a certain ID theres a form popping up saying "Enter PArameter Value" and if i put any numeric value in that my report view will show but no data i mean its blank report...
这篇关于报告视图(动态视图)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文