这可能吗? - 使用列表框更新true / false字段 [英] Is this possible? - update a true/false field using listbox

查看:82
本文介绍了这可能吗? - 使用列表框更新true / false字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨专家,我希望你可以帮我解决这个问题。我最近发现了如何使用INSERT INTO语句将多个记录从列表框添加到表中,我现在需要在另一个表中更新记录使用多选列表框的表。


问题:


我想通过显示48 x 30分钟来呈现工作时间模板间隔,每个间隔作为列表框中的一行。我的想法是,如果这个人通常在早上9点工作到下午5点,那么表格中的相关字段中有一个是/否。然后,我希望以列表框的形式修改工作时间,其中加载时显示所选的9-5行,可以通过选择更多行/取消选择行来修改,然后保存并更新表。


...我知道如何使用支票/选项框进行操作,我确定可以使用多选列表框来完成,但我不知道怎么做?


希望你能帮忙,OllyJ

Hi experts, I''m hoping you can help me with this.. I have recently found out how to use the INSERT INTO statement to add multiple records from a listbox to a table, I now need to UPDATE records in another table using a multi-select listbox.

Problem:

I want to present a template of working hours of staff by showing 48 x 30minute intervals, each as a row in a listbox. My idea is that if the person usually works 9am till 5pm, there is a yes / no in the relevant field in the table. I then want the working hours to be modified in the form of a listbox where when loaded it shows the 9-5 rows selected, and it can be modified by selecting more rows / deselecting rows, then saved and the table updated.

...I know how to do it with check / option boxes and i''m sure it can be done with multiselect list boxes but I just don''t know how?

Hope you can help, OllyJ

推荐答案

猜猜我的样本给你的想法:
http://www.geocities.com/nico5038/xS ... p-Down2000.zip

只需检查多行选择的使用以及表单底部字段中的值。 (SelStart和SelLength)


Nic; o)
Guess my sample gives you the idea:
http://www.geocities.com/nico5038/xS...p-Down2000.zip

Just check the use of multiple row selection and the values in the fields at the bottom of the form. (SelStart and SelLength)

Nic;o)


感谢您的回复Nico,非常感谢。我看了你的示例数据库...


我理解你如何更新FrmMoveLeftRight(RowSource中的SQL)中的列表框以获取''true''值一个列表框和另一个的错误值。我需要做的是将所有值都放在一个列表框中,但是在加载表单时,要选择的值为true,而false的值未选中但仍然可见。


我希望你能提供帮助,非常感谢提前


OllyJ
Thanks for your response Nico, much appreciated. I have had a look at your sample db...

I understand how you have updated the list boxes in FrmMoveLeftRight (SQL in RowSource) to get the ''true'' values in one listbox and the ''false'' values in the other. What I need to do is to have all values in one single listbox but on loading the form, the values that are ''true'' to be selected and those that are ''false'' not selected but still visible.

I hope you can help, many thanks in advance

OllyJ


示例数据库不仅显示了如何移动记录,但对你来说更重要的是,如何识别多行的选择。

我会通过将第一个列表框的记录源更改为选择全部来更改样本以满足您的需求( true和false)并显示True / False字段。另一个列表框可以完全删除。


最后你可以使用True / False来填充一个字段,该字段总是包含48个字符(每30分钟一个字符),并带有 + QUOT;和 - 记录工作时间的迹象。

我个人会写两个函数:

1)翻译临时小时表进入48字符串

2)使用True和False将字符串转换为48条记录。


得到这个想法?

Nic; o)
The sample database not only shows how to move the records, but more important for you, also how a selection of multiple rows will be recognized.
I would change the sample for your needs by changing the recordsource of the first listbox into selecting all (both true and false) and show the True/False field. The other listbox can be dropped entirely.

Finally you can use the True/False to fill a field that''s holding always 48 characters (one for each 30 minutes) with "+" and "-" signs to record the working hours.
Personally I would write two functions:
1) To translate the temporary "hours table" into the 48 charater string
2) To transform the string into 48 records with True and False.

Getting the idea ?

Nic;o)


这篇关于这可能吗? - 使用列表框更新true / false字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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