我需要有关DLookup标准的帮助 [英] I need help with DLookup criteria

查看:82
本文介绍了我需要有关DLookup标准的帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要我的DLookup标准[并且我*讨厌*不得不说这是我的可怜的单一标准!]这样说:Trim(fieldX)= strVar:


myVar = _

DLookup(" someField"," someTable"," Trim(fieldX)=''"& strVar&''" )


我不相信这会有效,而且我不会在一台机器上用

访问Access一段时间,所以有人可以告诉我如何写这个吗?


谢谢, - 帮助

解决方案

Thelma Lubkin写道:

我想要我的DLookup标准[而且我*讨厌*不得不说这是我糟糕的单一标准!]这样说:修剪(fieldX)= strVar:

myVar = _
DLookup(someField,someTable,Trim(fieldX)=''&& ; strVar&''")

我不相信这会rk,我不会在一台机器上有一段时间访问Access,所以有人可以告诉我怎么写这个吗?

谢谢, - -thelma



您可能想要改为喜欢。在A97

" fieldX Like *''" &安培; strVar& "''*")

看看喜欢的帮助


但为什么你需要修剪一个表字段来查找var。让我们说

字段宽度为10.如果你想要b / b
strVar,你可以使用领先的东西填充strVar =右(123& space(10),10)

将返回123




strVar =正确(" 123"& string(10," 0"),10)

将返回1230000000

如果您的字段是长度为10个字符,值为123。而且你的

strVar是123,没有必要修剪任何东西。


但你可能会发现喜欢成为你最好的解决方案


* salad:

Thelma Lubkin写道:

我想要我的DLookup标准[和我*讨厌*不得不说这是我糟糕的单一标准!]这样说:修剪(fieldX)= strVar:

myVar = _
DLookup(" someField" ,someTable,Trim(fieldX)=''"& strVar&''")

我不相信这会奏效,我赢了'在一台可以访问Access的机器上一段时间,有人可以告诉我如何写这个吗?

谢谢, - thethelma
您可能想要改为喜欢。在A97
fieldX Like *''" &安培; strVar&                             />
但是为什么你需要修剪一个表字段来寻找一个var。让我们说场地宽度是10.如果你想要......你可以使用领先的东西填充strVar
strVar =右(123& space(10) ),10)
将返回123


strVar =右(123& string(10," 0"),10)
将返回1230000000


如果她使用填充物,她不想要左,而不是正确吗?

如果你的字段长度为10个字符,值为123。而你的
strVar是123,没有必要修剪任何东西。

但你可能会发现喜欢成为你最好的解决方案



我也很困惑为什么这个领域需要修剪med。我想

从文本字段中访问丢弃的尾随空格。


-

Randy Harris

技术在promail dot com

我很确定我知道我记得的一切。


Randy Harris写道:

* salad:

Thelma Lubkin写道:

我想要我的DLookup标准[和我*讨厌*不得不说
我可怜的单一标准!]这样说:修剪(fieldX)= strVar:

myVar = _
DLookup(someField," ; someTable"," Trim(fieldX)=''"& strVar&''")

我不相信这会起作用,我不会在一台可以访问Access的机器上一段时间,有人可以告诉我如何写这个吗?

谢谢, - thethelma

fieldX Like *''" &安培; strVar& "''*")
看看喜欢的帮助



沙拉,她不想要单引号内的星号吗?




你是对的。高级时刻。


I would like my DLookup criteria [and I *hate* having to say that for
my poor single criterion!] to say this: Trim(fieldX) = strVar:

myVar = _
DLookup("someField", "someTable", "Trim(fieldX) = ''" & strVar & ''")

I don''t believe that this will work, and I won''t be at a machine with
access to Access for a while, so can someone please tell me how to write
this?

thanks, --thelma

解决方案

Thelma Lubkin wrote:

I would like my DLookup criteria [and I *hate* having to say that for
my poor single criterion!] to say this: Trim(fieldX) = strVar:

myVar = _
DLookup("someField", "someTable", "Trim(fieldX) = ''" & strVar & ''")

I don''t believe that this will work, and I won''t be at a machine with
access to Access for a while, so can someone please tell me how to write
this?

thanks, --thelma


You might want to do Like instead. In A97
"fieldX Like *''" & strVar & "''*")
Look at Like in help

But why do you need to trim a table field to look for a var. Let''s say
the field width is 10. You can pad strVar with leading stuff if you
want to...
strVar = Right("123" & space(10),10)
will return "123 "

Or
strVar = Right("123" & string(10,"0"),10)
will return "1230000000"
If your field is 10 chars in length and the value is "123" and your
strVar is "123", there''s no need to trim anything.

But you might find Like to be your best solution


* salad:

Thelma Lubkin wrote:

I would like my DLookup criteria [and I *hate* having to say that for
my poor single criterion!] to say this: Trim(fieldX) = strVar:

myVar = _
DLookup("someField", "someTable", "Trim(fieldX) = ''" & strVar & ''")

I don''t believe that this will work, and I won''t be at a machine with
access to Access for a while, so can someone please tell me how to write
this?

thanks, --thelma
You might want to do Like instead. In A97
"fieldX Like *''" & strVar & "''*")
Look at Like in help



Salad, wouldn''t she want the asterisks inside the single quotes?

But why do you need to trim a table field to look for a var. Let''s say
the field width is 10. You can pad strVar with leading stuff if you
want to...
strVar = Right("123" & space(10),10)
will return "123 "

Or
strVar = Right("123" & string(10,"0"),10)
will return "1230000000"

If she used the padding, wouldn''t she want Left, rather than Right?

If your field is 10 chars in length and the value is "123" and your
strVar is "123", there''s no need to trim anything.

But you might find Like to be your best solution


I too am puzzled why the field would need to be "Trim"med. I thought
Access discarded trailing spaces from text fields.

--
Randy Harris
tech at promail dot com
I''m pretty sure I know everything that I can remember.


Randy Harris wrote:

* salad:

Thelma Lubkin wrote:

I would like my DLookup criteria [and I *hate* having to say that for
my poor single criterion!] to say this: Trim(fieldX) = strVar:

myVar = _
DLookup("someField", "someTable", "Trim(fieldX) = ''" & strVar & ''")

I don''t believe that this will work, and I won''t be at a machine with
access to Access for a while, so can someone please tell me how to write
this?

thanks, --thelma


You might want to do Like instead. In A97
"fieldX Like *''" & strVar & "''*")
Look at Like in help


Salad, wouldn''t she want the asterisks inside the single quotes?



You''re right. Senior moment.


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

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