AND的麻烦 [英] Trouble with AND

查看:64
本文介绍了AND的麻烦的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要帮助才能使这种语法起作用。

我想根据双重标准打开一个特定记录的表单。

这两个字段都是文本字段。输入。

我收到错误消息类型不匹配


stLinkCriteria =" [PartNumber] =" &安培; "" &安培;我![txtPartNumber]& "" AND

" [MacPacNumber] =" &安培; "" &安培;我![txtMacPacExisting]& "''"

帮助,

Rick

I need help getting this syntax to work.
I want to open a form to a specific record based on dual criteria.
Both fields are text fields as is the input.
I get an error message "type mismatch"

stLinkCriteria = "[PartNumber]=" & "''" & Me![txtPartNumber] & "''" AND
"[ MacPacNumber]=" & "''" & Me![ txtMacPacExisting] & "''"
HELP,
Rick

推荐答案



" 2D Rick" < RB ******* @ compuserve.com>在消息中写道

news:11 ********************* @ l41g2000cwc.googlegro ups.com ...

"2D Rick" <rb*******@compuserve.com> wrote in message
news:11*********************@l41g2000cwc.googlegro ups.com...
我需要帮助才能使这种语法起作用。
我想根据双重标准打开一个特定记录的表单。
这两个字段都是文本字段和输入。
我得到错误消息类型不匹配

stLinkCriteria =" [PartNumber] =" &安培; "" &安培;我![txtPartNumber]& "" AND
[MacPacNumber] =" &安培; "" &安培;我![txtMacPacExisting]& "''"

帮助,
Rick
I need help getting this syntax to work.
I want to open a form to a specific record based on dual criteria.
Both fields are text fields as is the input.
I get an error message "type mismatch"

stLinkCriteria = "[PartNumber]=" & "''" & Me![txtPartNumber] & "''" AND
"[ MacPacNumber]=" & "''" & Me![ txtMacPacExisting] & "''"
HELP,
Rick




表格中有哪些数据类型?



What are the data types in the tables?


分隔符

text:单引号,''some text''

date:#10/12/04#

数字:没有

delimiters
text: single quote, ''some text''
dates: #10/12/04#
numbers: nothing


您使用单引号作为分隔符。是否有任何数据中包含

撇号?

基础表中两个字段的数据类型是什么?


这部分可能是问题所在:

& ; ""和[MacPacNumber] ="


应该是


& "''和[MacPacNumber] ="


AND需要在引号内。这是传递给strLinkCriteria的文本的一部分

。 &'s是ands。串联。

只需要选择一点。


] =" &安培; "" &

你不需要额外的报价和& (但它不应该伤害

任何东西),这可能只是

] =''" &


" [MacPacNumber] =",![txtMacPacExisting]

M和t前面有一个空格。 />

-

Wayne Morgan

MS Access MVP

" 2D Rick" < RB ******* @ compuserve.com>在消息中写道

news:11 ********************* @ l41g2000cwc.googlegro ups.com ...
You''re using single quotes as delimiters. Does any of the data have an
apostrophe in it? What are the data types of the two fields in the
underlying table?

This part is probably the problem:
& "''" AND "[ MacPacNumber]="

Should be

& "'' AND [MacPacNumber]="

The AND needs to be inside the quotes. It is part of the text being passed
to strLinkCriteria. The &''s are the "ands" for the concatenation.
Just to nit-pick a little.

]=" & "''" &
You don''t need the extra set of quotes and & (but it shouldn''t hurt
anything), this could be just
]=''" &

"[ MacPacNumber]=", ![ txtMacPacExisting]
There is a space in front of the M and the t.

--
Wayne Morgan
MS Access MVP
"2D Rick" <rb*******@compuserve.com> wrote in message
news:11*********************@l41g2000cwc.googlegro ups.com...
我需要帮助才能使这种语法起作用。
我想根据双重标准打开一个特定记录的表单。
这两个字段都是文本字段和输入。
我得到错误消息类型不匹配

stLinkCriteria =" [PartNumber] =" &安培; "" &安培;我![txtPartNumber]& "" AND
[MacPacNumber] =" &安培; "" &安培;我![txtMacPacExisting]& "''"
I need help getting this syntax to work.
I want to open a form to a specific record based on dual criteria.
Both fields are text fields as is the input.
I get an error message "type mismatch"

stLinkCriteria = "[PartNumber]=" & "''" & Me![txtPartNumber] & "''" AND
"[ MacPacNumber]=" & "''" & Me![ txtMacPacExisting] & "''"



这篇关于AND的麻烦的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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