创建一个弹出窗口与组合框报告(不工作在我的情况) [英] Create a popup window for report with a combobox ( Isn't working in my case )
问题描述
放大: http://i.stack.imgur.com/qUIDR.png一> 我创建了一个形式,用一个简单的组合框的窗口。我认为它与where子句指的是从和组合框的值相关的查询。我在报告中写了code
私人小组Report_Load()
frm.Customers.Show
结束小组
但不知何故,它首先打开查询不是形式本身。我的意思是,查询要我输入 [表格]![frm_Customers]![cbo_customers]。[值]
当我独自运行一切形式开辟了正常。你能告诉我为什么吗?
查询编辑:
SELECT dbo_listy.listnumb,dbo_listy.id,dbo_listy.created,dbo_listy.type
从dbo_listy
WHERE forwho =形式frm_Customers cbo_customers.value;!
首先打开窗体,然后使用的的OpenReport 在一个命令按钮:
EX pression.OpenReport(REPORTNAME,查看,FILTERNAME,_
WhereCondition,WindowMode,OpenArgs)
DoCmd.OpenReportMyReport,,,身份识别码=&放大器; Me.txtID
或者在您的案件
DoCmd.OpenReportMyReport,acView preVIEW ,,ID =&放大器; Me.cbo_customers
请注意,该报告应根据全套数据,WHERE语句将其限定为在Me.txtID或cbo_customers客户ID
编辑正如我上面所说,查询应包括全套的记录,那就是:
SELECT dbo_listy.listnumb,
dbo_listy.id,
dbo_listy.created,
dbo_listy.type
从dbo_listy
参见的http:// MSDN .microsoft.com / EN-US /图书馆/办公室/ bb225993(V = office.12)的.aspx
zoom in : http://i.stack.imgur.com/qUIDR.png I created a form as a window with a simple combobox. I got a query that its related to with the where clause referring to the from and value of the combobox. I wrote a code in the report
Private Sub Report_Load()
frm.Customers.Show
End Sub
But somehow it opens first the query not the form itself. I mean by that the query wants me to input the [Forms]![frm_Customers]![cbo_customers].[value]
When I run the form alone everything opens up normally. Can you tell me why?
Query EDIT:
SELECT dbo_listy.listnumb, dbo_listy.id, dbo_listy.created, dbo_listy.type
FROM dbo_listy
WHERE forwho =Forms!frm_Customers!cbo_customers.value;
Open the form first, then use OpenReport in a command button:
expression.OpenReport(ReportName, View, FilterName, _
WhereCondition, WindowMode, OpenArgs)
DoCmd.OpenReport "MyReport",,,"MyID=" & Me.txtID
Or in your case
DoCmd.OpenReport "MyReport",acViewPreview,,"id=" & Me.cbo_customers
Note that the report should be based on the full set of data, the WHERE statement will limit it to the customer ID in Me.txtID or cbo_customers
EDIT as I said above, the query should include the full set of records, that is:
SELECT dbo_listy.listnumb,
dbo_listy.id,
dbo_listy.created,
dbo_listy.type
FROM dbo_listy
See also http://msdn.microsoft.com/en-us/library/office/bb225993(v=office.12).aspx
这篇关于创建一个弹出窗口与组合框报告(不工作在我的情况)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!