需要有关组合框循环/打开报告的帮助 [英] Need help with combo box loop/open report

查看:50
本文介绍了需要有关组合框循环/打开报告的帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前有一个包含所有员工姓名的组合框的表单。组合框调用包含所有员工记录的表,并根据所选员工生成报告


我有两个按钮,导出单个报告,通过选择员工完成从组合框中点击按钮后,将报告导出为PDF到写入的路径

第二个按钮将所有报告作为单独的报告导出到写入的路径(因为有数百个员工需要花费太多时间单独出口)。 PDF由组合框的lastname_firstname(第2列和第1列)保存。


现在第二个按钮在循环组合框时正确标记PDF,但每次报告时打开代码不会注册选择哪个员工,也不会使用正确的员工记录更新报告。所有报告都保存为空白。


我添加了以下代码,有人可以帮助找出报告打开时的方式,它可以识别组合框中的员工,并在打开之前更新!


谢谢


I currently have a form that contains a combobox with all the employee names. The combo box calls to a table that contains all of the employee records and generates a report based on the selected employee

I have two buttons, export individual report which is done by selecting an employee from the combo box and once the button is clicked exports the report to PDF to the path written

The second button exports all reports as individual reports to the path written (since there are hundreds of employees it would take too much time to export each individually). The PDF is saved by lastname_firstname (column2 and column 1) of the combo box.

Now the second button labels the PDFs correctly as it loops through the combo box, but each time the report is opened the code does not register which employee is being selected and does not update the report with the correct employee records. All of the reports are saved as blanks.

I added the code below, can someone please help figure out a way for when the Report opens it recognizes which employee it is on in the combobox and updates before opening!

Thank you



展开 | 选择 | Wrap | 行号

推荐答案

我怀疑你的问题是你的OpenReport没有过滤器。


尝试使用Where子句或过滤器为正确的员工打开报告。基于您的
Forms!ReportOpener!cmbReportEmployee.Column(1,intCount& Forms!ReportOpener!cmbReportEmployee.Column(2,intCount)...

Phil
I suspect that your problem is that your OpenReport has no filter with it.

Try a Where clause or a Filter to open the report for the correct Employee. Based on your
Forms!ReportOpener!cmbReportEmployee.Column(1, intCount & Forms!ReportOpener!cmbReportEmployee.Column(2, intCount)...
Phil


PhilOfWalton,


是的,这就是我想弄清楚的。我应该打电话到桌子吗包含记录并包含组合框的列和inCount以匹配记录?
PhilOfWalton,

Yes, that is what I am trying to figure out. Should I call to the table that contains the records and include the column and inCount of the combobox to match to the records?


确定。首先我怀疑你所谓的组合框实际上是一个多选列表box(List0)。

列是EmpSurname,EmpFirstName& EmpID


尝试此代码作为基础
OK. First I suspect that what you are calling a Combo box is in fact a multi select list box (List0).
Columns are EmpSurname, EmpFirstName & EmpID

Try this code as a basis
展开 < span class =codeDivider> | 选择 | 换行 | 行号


这篇关于需要有关组合框循环/打开报告的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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