从Microsoft Access中的列表框中删除所选项目 [英] Remove selected items from List Box in Microsoft Access

查看:308
本文介绍了从Microsoft Access中的列表框中删除所选项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Access 2003.


我有一个列表框,我通过从下拉组合框中选择项目来填充。我现在想要从列表框中删除所选的但不一定是顺序的项目(一次一个或几个)。


我在这个网站上找到了一些代码:
http://www.599cd.com/tips / access / listbox-additem-2000 /

作者建议创建一个文本框,然后首先临时存储在列表框中选择的文本,如下所示: br />

展开 | 选择 | Wrap | 行号

解方案
如果列表框被手动填充此方法才有效。如果RowSource是一个查询,那么这将不起作用。


可以进行多项选择,但我建议你先让基础知识正常工作。


欢迎使用字节


如果列表框的行来源是值列表,您可以使用以下代码,不需要使用文本框:

展开 | 选择 | Wrap | < span class =codeLinkonclick =LineNumbers(this);>行号


@NeoPa


谢谢。列表框是手动填充的 - 我将首先处理基础知识。


I''m using Access 2003.

I have a List Box which I populate by selecting items from a drop down Combo Box. I now want to delete from the List Box only the selected, but not necessarily sequencial items (either one at a time or several).

I found some code at this website:
http://www.599cd.com/tips/access/listbox-additem-2000/

The author suggests creating a Text Box, then first temporarily storing the text that is selected in the List Box as follows:

Expand|Select|Wrap|Line Numbers

解决方案

This approach will only work if the ListBox is populated manually. If RowSource is a query then this will not work.

Multiple selections can be made to work, but I suggest you get the fundamentals working correctly first.

Welcome to Bytes!


If the Row Source of your List Box is a Value List, you can use the following code which does not require the use of a Text Box:

Expand|Select|Wrap|Line Numbers


@NeoPa
Thanks. The Listbox is populated manually - I''ll work on the fundamentals first.


这篇关于从Microsoft Access中的列表框中删除所选项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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