通过VBA查询将表单值传递到查询中。 [英] Passing form values into a query through a VBA Query.

查看:84
本文介绍了通过VBA查询将表单值传递到查询中。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试通过表单将日期参数传递到VBA代码时,查询不包含任何记录。但是,如果值放在查询中,则返回值,例如,插入

When attempting to pass date parameters through a form into VBA code, the query contains no records. however, if the values are placed in the query, values are returned, for instance, plugging in

< span class =codeLinkonclick =Blur(this,this.parentNode.parentNode,getChildren(this),true);>展开 | 选择 | Wrap | 行号

推荐答案

我不明白为什么发布的日期文字不能像日期控件引用一样好( Literal DateTimes及其分隔符(#)可能会有所帮助)。但是,我无法理解你究竟在问什么,所以我不确定如何提供帮助。这大堆代码与这种情况有什么相关性?没有行#引用以澄清它可能适合的读者。
I cannot see why the date literals posted would not work just as well as the date control references (Literal DateTimes and Their Delimiters (#) may help). However, I can''t understand what you''re actually asking either, so I''m not sure how to help. What relevance has that great big pile of code got to the situation? No line # references to clarify for a reader where it may fit in.


尝试修改HAVING子句,即:
Try modifying the HAVING Clause, namely:
展开 | 选择 | Wrap | 行号


这应该可以在美国的任何地方可靠地工作。但是,从链接的文章中,可以通过将值明确地格式化为m / d / yyyy来实现可移植代码,当然,假设要求使用文字代替已经可用的值。
That should work reliably anywhere in the USA. From the linked article though, portable code is achieved by formatting the values explicitly as "m/d/yyyy", assuming of course, that the requirement is to use literals in place of the values already available.


这篇关于通过VBA查询将表单值传递到查询中。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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