使用表单输入报告的信息 [英] Using a form to input information for a report

查看:64
本文介绍了使用表单输入报告的信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


好​​吧,我已经玩了好几天了,到目前为止我没有在哪里。我所拥有的是我创建的一个表单,您输入一些数据以便提取报告。我有一个已经很好用的报告和查询,所以我试图将它整合到报告中。现在它的设置如果你打开报告,你必须输入一个日期范围,位置名称和班次号码我想做的是这样我可以输入我已经设置的表格和查询将取消您在表单中输入的信息,而不是要求您输入的小弹出框。


我做的一件事是我设置的班次号码5个切换按钮,表示数字1 - 5,所以当我按下切换按钮我想要将查询作为班次编号注册,然后在文本框中键入位置名称和日期范围。


我发现一个网站似乎有我正在寻找的信息,但现在已经玩了几天,我不知道我做错了什么。


任何帮助都会很棒,谢谢


这里是找到的网站,

http:// office .microsoft.com / zh-CN / access / HP051874111033.aspx

Hi everyone,

Well i have been playing with this for a few days and so far im getting no where. What I have is a form I created that you input a little data in order to pull a report. I have a report and query that already work great so im trying to intergrate it in to the report. Right now its set up where if you open the report you have to type in a date range, location name, and shift number what i want to do is make it so I can type that information in to a form i have set up and the query will go off of the information you type in the form instead of the little pop up boxes asking you to type it in.

One thing I did was for the shift number I set up 5 toggle buttons that would represent numbers 1 - 5 so when I press a toggle button i want that to register to the query as shift number, then you type in a location name and date range in text boxes.

I found a website that seems to have the information im looking for but been playing with it for a couple days now and im not sure what im doing wrong.

Any help would be great thanks

here is the site if found,
http://office.microsoft.com/en-us/access/HP051874111033.aspx

推荐答案

打开报表时可以在openarg参数中传递变量(然后在在报表中),您可以直接将报表查询条件基于表单中的控件(表单必须保持打开状态),或者您可以使用表单设置过滤字符串,并在打开时将该过滤字符串传递给报表。


在大多数情况下,我会使用过滤字符串。
You can pass the variables in the openarg argument when opening the report(And then process it in within the report), you can base the reports query criteria directly upon the controls in the form (the form must then stay open) or you can use the form to setup a filter string, and pass that filter string to the report when opening it.

In most cases I would go with using the filter string.
展开 | 选择 | 涡卷 | 行号


您好TSO,


很好的例子!!似乎正是我想要的。只有一个问题。不知道在哪里放这个。你说使用表单设置一个过滤字符串,但我会把它放在哪里?在表单命令?或者在打印命令按钮中?或者我应该把它放在宏中,然后在按下按钮时引用宏?


再次感谢!
Hi TSO,

Nice example!! Seems to be exactly what I was looking for. Just having one problem. Not sure where to put this. You said to use the form to set up a filter string but where would i put this? In the form commands? Or in the print command button? Or should I put it in a macro and then reference the macro when the button is pressed?

Thanks again!


我会把它放在打印命令按钮中。如果您希望直接打印报告而不进行预览,请将 acPreview 替换为 acNormal

我自己完全停止使用宏,因为我似乎发现使用部分VBA代码和部分宏令人困惑。此外,我发现VBA的功能要强1000倍。
I would put it in the print command button. If you want the report to print directly, without previewing, jsut replace acPreview with acNormal.
I myself have completely stopped using macros, as I seem to find it confusing to use part VBA code and part macros. Besides I find VBA to be 1000x more powerfull.


这篇关于使用表单输入报告的信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆