不必要地访问请求查询参数? (访问VBA和SQL) [英] Access asking for a query parameter unnecessarily? (Access VBA and SQL)

查看:65
本文介绍了不必要地访问请求查询参数? (访问VBA和SQL)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 -


我有一个绑定表单,其中有一堆文本框连接到各个字段。当有人在 txtSearch 中键入搜索值并选​​择标签或按Enter键时,将运行以下代码(变量声明,错误处理和清除省略):

Hi -

I have a bound form with a bunch of text boxes connected to various fields. When someone types a search value into txtSearch and either tabs out or hits Enter, the following code runs (variable declarations, error handling and clean up omitted):

展开 < span class =codeDivider> | 选择 | Wrap | Line数字

推荐答案

抱歉,我对querydef和参数不太熟悉。 http://support.microsoft.com/kb/142938 上的表格有Text,但是没有将CHAR列为变量类型,示例也没有使用[]。也许这可能是问题的一部分?
Sorry, I''m not too familiar with querydefs and parameters. The table at http://support.microsoft.com/kb/142938 has Text, but doesn''t list CHAR as a variable type, nor does the example use [ ]. Maybe that could be part of the problem?


重新格式化你的代码是清晰的,我想知道你的意思是说你已经在PARAMETER中指定了[lastName]的值(S声明。当然已经指定了类型,但没有传递任何价值。


你究竟想做什么?


你有没有价值您创建SQL时代码可用的[LastName](您想要使用)?
Having reformatted your code to be legible, I wonder what you mean by saying you have already specified the value of [lastName] in your PARAMETER(S) statement. Certainly the type has been specified, but no value is passed.

What are you actually trying to do?

Do you have the value of [LastName] (that you want to use) available to the code at the time the SQL is created?


Hi Chip -


谢谢作出回应。我确实将参数类型更改为TEXT,但似乎并不重要。我认为CHAR很好,因为它确实打开了记录集,好像用它写出来的那样。


显然,括号也没关系。但感谢您的建议!


Pat
Hi Chip -

Thanks for responding. I did change the parameter type to TEXT, but it doesn''t seem to matter. I figured CHAR was fine because it does actually open the recordset okay with it written out like that.

The brackets don''t matter either, apparently. But thanks for the suggestions!

Pat


这篇关于不必要地访问请求查询参数? (访问VBA和SQL)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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