查询包含引用表单控件的参数时的OpenRecordset问题 [英] OpenRecordset problem when query includes parameters that reference to form controls
本文介绍了查询包含引用表单控件的参数时的OpenRecordset问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我得错了结果当我用代码打开一个带有记录集的查询时:
Hi,
I got wrong result When I open a query as recordset with code:
展开 | 选择 | Wrap | 行号
推荐答案
您确定吗?
在末尾添加。[Value] 形式]![FrmRpt]![txtNHM1] 是不必要的,就我所见,不正确的SQL没有运行。 SQL不以VBA代码的方式管理VBA对象。名称中的任何点(。)都被视为未知项目。
为什么不准确地说出你尝试的内容以及当你这样做时到底发生了什么。
Are you sure?
Adding .[Value] at the end of [forms]![FrmRpt]![txtNHM1] is both unnecessary and, as far as I''ve ever seen, incorrect SQL that doesn''t run. SQL doesn''t manage VBA objects in the way VBA code can. Any dot (.) in a name is treated as an unknown item.
Why don''t you say exactly what you try and exactly what occurs when you do.
我认为SQL只是不识别形式(FrmRpt)。txtNHM1.value,但它确实识别[forms]![FrmRpt]![txtNHM1]。[Value]。
无论如何我尝试删除。[Value],但仍然相同。表达似乎是导致问题的真正原因。
I think SQL only doesn''t recognize forms("FrmRpt").txtNHM1.value , but it does recognize [forms]![FrmRpt]![txtNHM1].[Value].
Anyway I tried removing ".[Value]", but still the same. It seems the expression is the real reason causing problem.
展开 | 选择 | Wrap | 行号
Difei:
给出错误的结果(记录不符合where条件)
Difei:
gives incorrect result (records don''t meet the where condition)
我需要更多。我需要知道哪些记录没有显示但你认为它们应该([RTM]和[LoanV]的值)和 [形式]的价值是什么![FrmRpt]![运行测试时,txtNHM1] 。我假设在某些你没有处理的地方可能有一个Null值,但是在我有一些数据可以使用之前我无能为力。
I need more than this. I need to know what are the records which don''t show but you think they ought to (values for [RTM] & [LoanV]) and what is the value of [forms]![FrmRpt]![txtNHM1] when you ran the test. I assume there may be a Null value somewhere you''re not handling, but until I have some data to work with I cannot be much help.
这篇关于查询包含引用表单控件的参数时的OpenRecordset问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文