报告表单中的当前筛选记录(在ADP项目中) [英] Report the current filtered records from a Form (in an ADP project)

查看:78
本文介绍了报告表单中的当前筛选记录(在ADP项目中)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

---从表格(在ADP项目中)报告当前过滤的记录---


Hello All,


我之前已经看过这个主题,但是我所描述的解决方案在我的特定情况下并不起作用。


我的配置:Access 2002前端使用SQL Server 2000( MSDE实际上是通过ADP / ADE访问数据项目。


我有一个表单(包含大约80个字段),我允许用户应用字段/表单过滤器 - 这工作正常。


表格有<打印报告>按钮应该根据过滤的记录集触发报告 - 这不起作用。


我已经在按钮的点击事件处理程序中尝试了以下VBA代码,我读过应该在普通的Access中工作,但是因为我在后端使用SQL Server而失败了。

---Report the current filtered records from a Form (in an ADP project)---

Hello All,

I''ve seen this topic discussed before, but the solution described then doesn''t work in my particular case.

My Config: Access 2002 front-end using SQL Server 2000 (MSDE actually) via ADP/ADE Access Data Project.

I have a form (containing about 80 fields) on which I allow the user to apply field/form filters -- this works fine.

The form has a <print report> button which should trigger a report based on that filtered recordset -- this does not work.

I''ve tried the following VBA code in the button''s click event handler, which I''ve read should work in plain Access, but fails for me because I''m using SQL Server at the back-end.

展开 | 选择 | Wrap | 行号

推荐答案

在关于打开事件的报告中,您可以重置记录源

In a reports on open event you can reset the recordsource

展开 | 选择 | Wrap | 行号


获取sql string你可以创建一个字符串的全局变量并在其他地方填充它。
To get the sql string you could create a global variable of a string and populate it elsewhere.


非常感谢你的回复,mmccarthy,但是(如果我不对,请原谅我!)我不认为你的建议解决了我的核心问题。


在我的ADP项目中,我正在尝试报告表格中最新的数据 - 按现在我意味着包括用户已经完成的任何字段/表单过滤。


我显示的代码示例试图通过表单中的Me.Filter变量确定当前用户过滤器的内容。


问题是Me.Filter字符串(本质上是一个没有单词WHERE的sql WHERE子句)是在Access / Jet的sql语法中,但显然需要在SQLServer的语法中使用报告,我认为仍然会利用您建议的技术。


对不起,思考这个回复的一部分,但是我今天或者明天都没有在合适的电脑上试试你的想法,我想尽快答复你的答复。


顺便说一下,在我参与的另一个帖子中有一些关于你的好话:http://www.thescripts.com/forum/thread555184.html


谢谢非常感谢您的投入,


-radio1
Thanks very much for the reply, mmccarthy, but (and please forgive me if I''m incorrect!) I don''t think your suggestion addresses my core problem.

In my ADP project, I''m trying to Report the data that is current in a Form -- by current I mean including any field/form filtering the user has done.

The code example I''ve shown tries to determine what the current user filters are via the Me.Filter variable from the Form.

The problem is that the Me.Filter string (essentially a sql WHERE clause without the word "WHERE") is in Access/Jet''s sql syntax, but apparently needs to be in SQLServer''s syntax to be used by the Report, and I think that would still be the case utilizing your suggested technique.

Sorry for the "think" part of this reply, but I''m not at the right computer to try out your idea today or probably tomorrow, and I wanted to at least acknowledge your reply as soon as I could.

By the way, some nice things are said about you in this other thread I was involved in: http://www.thescripts.com/forum/thread555184.html

Thank you very much again for your input,

-radio1


这篇关于报告表单中的当前筛选记录(在ADP项目中)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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