忽略组合框文本中的空格 [英] Ignoring spaces in combobox text

查看:47
本文介绍了忽略组合框文本中的空格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将用户的选项限制为

组合框文本提供的选项,但我不希望这扩展到他的空间如何

文本,例如

''abcdefg''和'ab cd efg''

应该是等价的。我知道如何比较字符串,看看他们是否符合这个标准 - 我不知道如何让组合框知道这是我想要的。


我想在NotInList_event中处理这个问题,但我不知道如何获得组合框的有效值。

我也有一种感觉,我应该能够设置一个验证

标准,这将使这个微不足道......


谢谢, - thethelma

解决方案



" Thelma Lubkin" <第**** @ alpha2.csd.uwm.edu> schreef在bericht新闻:d7 ********** @ uwm.edu ...

我试图将用户的选项限制为''abcdefg''和''ab cd efg''
应该是等价的。我知道如何比较字符串以确定它们是否符合这个标准 - 我不知道如何让组合框知道这就是我想要的。

我想在NotInList_event中处理这个问题,但我不知道如何获得组合框的有效值。
我也有一种感觉,我应该能够设置一个验证
标准,这将使这个微不足道...

谢谢, - thethelma




只发生NotInList_event当LimitToList设置为True ...

所以我认为这不是你想要的。


我会将LimitToList设置为false并验证输入(在BeforeUpdate_Event中删除了空格?)

您可以对查询使用DLookup(可能是你的组合的rowsource吗?)。


Arno R


Arno R< ar *********** @ tiscali.nl>写道:


:Thelma Lubkin <第**** @ alpha2.csd.uwm.edu> schreef在bericht新闻:d7 ********** @ uwm.edu ...

:>我试图将用户的选项限制为由

:>组合框文本,但我不希望这扩展到他如何分隔

:>文字,例如

:> ''abcdefg''和''ab cd efg''

:>应该是等价的。我知道如何比较字符串以查看

:>他们符合这个标准 - 我不知道怎么让组合框知道

:>这就是我想要的。

:> < snip>


:NotInList_event仅在LimitToList设置为True时发生...

:所以我认为这不是你想要的。


:我会将LimitToList设置为false并验证BeforeUpdate_Event中的输入(删除空格?)。

:您可以对查询使用DLookup(也许你的组合的行源?)为此。


谢谢 - 我认为这正是我想要的。


我想要的使用NotInList触发器,因为如果我设置

LimitToList false我将需要决定是否需要通过Dlookup去

:如果我限制列出额外的代码将

只能看到看起来不合法的文字

组合框

谢谢你的帮助。

--thelma

:Arno R




" Thelma Lubkin" <第**** @ alpha2.csd.uwm.edu> schreef in bericht news:d7 ********** @ uwm.edu ...

:NotInList_event仅在LimitToList设置为True时发生... < br:>所以我认为这不是你想要的。

:我会将LimitToList设置为false并验证BeforeUpdate_Event中的输入(删除空格?)。
:你可以使用针对查询的DLookup(也许是你的组合的行源?)。

谢谢 - 我认为这正是我想要的。

我想要使用NotInList触发器,因为如果我设置
LimitToList为false,我将需要决定是否需要通过Dlookup来进行
:如果我限制列出额外的代码将仅用于文本对于
组合框看起来不合法
谢谢你的帮助。




我建议你将LimitToList设置为false,所以这意味着事件不会开火。

我如果你坚持使用LimitToList你就不能接受带空格的值除非你在组合中添加这些值...

我不认为这是你想要的,或者??? br />

回到原来的建议:

- 将LimitToList设置为false

- 根据查询验证输入(你的例如combo)在BeforeUpdate事件中

(你会删除变量中的空格我猜??)

- 如果验证然后继续(接受值)

- 如果没有验证,则将cancel设置为True(强制用户转到另一个有效输入)


我假设你有一个删除空格的功能正如你所说的那样。

我也假设你知道如何使用DLookup

如果不回复(在这个帖子中)请。

在这一刻,我不确定*确切地说*你遇到了什么问题,除了使用LimitToList,你不应该使用IMO。


Arno R


I am trying to limit the user''s options to the choices offered by the
combobox text, but I don''t want this to extend to how [s]he spaces out
the text, e.g.
''abcdefg'' and ''ab cd efg''
should be equivalent. I know how to compare strings to see whether
they meet this criterion--I don''t know how to let the combobox know
that this is what I want.

I am thinking of dealing w/ this in the NotInList_event, but I don''t
know how to get to the combobox''s valid values.
I also have a feeling that I should be able to set up a validation
criterion that will make this trivial...

thanks, --thelma

解决方案


"Thelma Lubkin" <th****@alpha2.csd.uwm.edu> schreef in bericht news:d7**********@uwm.edu...

I am trying to limit the user''s options to the choices offered by the
combobox text, but I don''t want this to extend to how [s]he spaces out
the text, e.g.
''abcdefg'' and ''ab cd efg''
should be equivalent. I know how to compare strings to see whether
they meet this criterion--I don''t know how to let the combobox know
that this is what I want.

I am thinking of dealing w/ this in the NotInList_event, but I don''t
know how to get to the combobox''s valid values.
I also have a feeling that I should be able to set up a validation
criterion that will make this trivial...

thanks, --thelma



The NotInList_event only occurs when LimitToList is set to True ...
So I think this is not what you want.

I would set LimitToList to false and validate the input (spaces removed ?) in the BeforeUpdate_Event.
You could use a DLookup against a query (maybe the rowsource for your combo?) for this.

Arno R


Arno R <ar***********@tiscali.nl> wrote:

: "Thelma Lubkin" <th****@alpha2.csd.uwm.edu> schreef in bericht news:d7**********@uwm.edu...
:>I am trying to limit the user''s options to the choices offered by the
:> combobox text, but I don''t want this to extend to how [s]he spaces out
:> the text, e.g.
:> ''abcdefg'' and ''ab cd efg''
:> should be equivalent. I know how to compare strings to see whether
:> they meet this criterion--I don''t know how to let the combobox know
:> that this is what I want.
:> <snip>

: The NotInList_event only occurs when LimitToList is set to True ...
: So I think this is not what you want.

: I would set LimitToList to false and validate the input (spaces removed ?) in the BeforeUpdate_Event.
: You could use a DLookup against a query (maybe the rowsource for your combo?) for this.

Thank you -- I think that this is exactly what I want.

I want to use the NotInList trigger because if I set
LimitToList false I will need to decide whether I need to go
through a Dlookup: if I limit to list the extra code will
only be seen for text that doesn''t look legal to the
combobox
thank you for the help.
--thelma
: Arno R



"Thelma Lubkin" <th****@alpha2.csd.uwm.edu> schreef in bericht news:d7**********@uwm.edu...

: The NotInList_event only occurs when LimitToList is set to True ...
: So I think this is not what you want.

: I would set LimitToList to false and validate the input (spaces removed ?) in the BeforeUpdate_Event.
: You could use a DLookup against a query (maybe the rowsource for your combo?) for this.

Thank you -- I think that this is exactly what I want.

I want to use the NotInList trigger because if I set
LimitToList false I will need to decide whether I need to go
through a Dlookup: if I limit to list the extra code will
only be seen for text that doesn''t look legal to the
combobox
thank you for the help.



I advised you to set LimitToList to false, so this means the event does NOT fire then.
If you insist in LimitToList you can''t accept values with spaces UNLESS you add these values in the combo ...
I don''t think this is what you want, or ???

So back to the original advice:
-- Set LimitToList to false
-- Validate the input against a query (your combo for instance) in the BeforeUpdate-event
(You will remove the spaces in a variable I guess ??)
-- If validated then continue (value is accepted)
-- If not validated then set cancel to True (force the user to another valid input)

I assume that you have a function to remove the spaces as you told.
I also assume that you know how to use DLookup
If not post back (in this thread) please.
For this moment I am not sure where *exactly* you are having problems, other than using LimitToList where IMO you should not.

Arno R


这篇关于忽略组合框文本中的空格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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