根据用户定义的查询打开报表 [英] Opening a report based on a user defined query

查看:83
本文介绍了根据用户定义的查询打开报表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在寻找一些时间(在Safari上阅读书籍,通过论坛搜索等)我找不到解决这个问题的方法。我转向可能能够帮助我的任何人。


我正在尝试使用Windows XP上的Microsoft Access 2003创建工作数据库。


我有一个产品许可数据库,它有一个名为序列号的表,该表包含与SN相关的所有信息,包括客户名称,客户状态,客户城市等等。大约30个字段,包括序列号字段。


我不可能创建一个报告来显示所有信息,所以我认为让用户定义他们希望在哪个字段上看到更方便报告。


我设置了表单来引导用户完成选择字段和设置顺序的过程,然后生成查询,向用户显示他们想要的信息。现在,查询工作并弹出我想要的查询,这里是代码:

I have been looking for some time now (reading books off Safari, searching through forums,etc) I have found no solution to this problem. I turn to anyone of you that may be able to help me.

I''m trying to create a database for work, using Microsoft Access 2003 on Windows XP.

I have a product licensing database and it has one table named serial numbers, that table holds all the information associated with SNs, including customer name, customer state, customer city.... etc etc. Its approximately 30 fields including the serial number field.

It would be impossible for me to create a report to show all the information, so I decided it would be more convenient to have the user define which fields they would like to see on the report.

I have forms set up to guide the user through the process of picking fields and setting the ordering, and then I generate the query that would present the user with the information they desire. Now, the query works and pops up the query I want, here is the code for that:

展开 | 选择 | Wrap | 行号

推荐答案

好的,你可以打开动态报告,但报告的格式不是很好。

OK you can open a dynamic report but the formatting of the report is not great.

< span class =codeLinkonclick =Blur(this,this.parentNode.parentNode,getChildren(this),true);>展开 | 选择 | Wrap | 行号


感谢您的回复!我有多难找到答案,我肯定不认为代码会像现在这么简短。我会在今天下午的某个时候尝试这个,让你知道它是怎么回事。另外,您是否有参考或任何指向我从哪里获得此信息?拥有大量资源总是好的。


另外,当我等待某人的回复时,我设法找到了这个链接,它显示了如何做一个动态报告,除了它使用交叉表查询...(我不能使用其中一个,因为它不会产生我想要的结果)但我试图修改代码。


以下是该链接:
http ://support.microsoft.com/default ...; zh-CN; Q328320
Thanks for the response! For how hard I had to search for an answer I sure didn''t think the code would be as short as it was. I will try this sometime this afternoon and let you know how it goes. Also, do you have a reference or anything pointing me to where you got this info from? Its always good to have a bunch of resources.

Also, while I was waiting for a response from someone I managed to find this link, which shows how to do a dynamic report except its using a crosstab query...(I can''t use one of them because it doesn''t produce the results I want) I am trying to modify the code however.

Here is that link:
http://support.microsoft.com/default...;en-us;Q328320



感谢您的回复!我有多难找到答案,我肯定不认为代码会像现在这么简短。我会在今天下午的某个时候尝试这个,让你知道它是怎么回事。另外,您是否有参考或任何指向我从哪里获得此信息?拥有大量资源总是好的。


另外,当我等待某人的回复时,我设法找到了这个链接,它显示了如何做一个动态报告,除了它使用交叉表查询...(我不能使用其中一个,因为它不会产生我想要的结果)但我试图修改代码。


以下是该链接:
http ://support.microsoft.com/default ...; en-us; Q328320



正如我所说,我给你的代码没有格式化报告非常好。


如果您需要施加格式,请使用上面的代码。专注于创建一个名为EmployeeSales的报告以后。


我给你的代码实际上可以在VBA帮助文件中找到。

As I said, the code I gave you doesn''t format the report very well.

If you need to impose a format then use the above code. Concentrate from Create a Report That Is Named EmployeeSales onwards.

The code I have given you can actually be found in the VBA help file.


这篇关于根据用户定义的查询打开报表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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