根据用户输入的Microsoft Access筛选报告 [英] Filter a Report based on user input Microsoft Access

查看:111
本文介绍了根据用户输入的Microsoft Access筛选报告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很抱歉,如果这是一个简单/直接的解决方案,但是我是Access的新手,我的报告一直存在一些问题.

My apologies if this is an easy/straightforward solution, but I am new to Access, and I have been having some problems with my reports.

我创建了一个报告模板,我想基于特定的ID NO打开一个单页报告.然后,报告中的所有字段均从关联的IDENT NO中生成.就目前情况而言,当我打开报告时,它将在打开时为报告数据"表中的每个ID号创建一个单页报告.

I have created a report template which I want to open a single page report based on a specific IDENT NO. All of the fields in the report are then generated from the associated IDENT NO. As it currently stands, when I open the report, it will create a single page report for each ID number in the Report Data table when opened.

相反,当用户尝试打开报告时,我希望它提示用户输入他们要查找的特定报告的标识号,以便它仅打开与输入的内容相关的单个1页报告身份证号码

Instead, when the user is attempting to open the report, I want it to prompt the user to enter the identification number of the specific report they are looking for so that it only opens that single individual 1 page report associated with the entered IDENT NO.

关于如何实现这种过滤的任何想法?

Any Ideas on how I could achieve this filtering?

推荐答案

您可以显示一个InputBox供用户插入ID,然后打开并过滤报告.

You can display an InputBox for the user to insert the ID and then open and filter the report.

Dim id As String
    id = InputBox("Enter the identification number:", "YourInputBoxTitle")

'if a value was entered, open and filter report
If Len(Trim(id)) > 0 Then
    DoCmd.OpenReport "ReportName", acViewPreview, , "[IDENT NO] = " & id, acWindowNormal
End If

这篇关于根据用户输入的Microsoft Access筛选报告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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