通过表单解析表字段 [英] parsing a table field through a form

查看:51
本文介绍了通过表单解析表字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题从表中读取并包含称为关键字的多值字段的表单。我已经知道拥有一个多值字段是一个可怕的想法,但是,我正在修补我没有创建的数据库中的一些东西,并且还有其他因素涉及我需要保留该特定的多值字段。我想做的是在旁边有8个下拉框,用于调用另一个表中的关键字列表。

我想要一个更新按钮,当点击并为特定记录时,来自8个下拉框的关键字将与它们之间的逗号(总共7个逗号)连接在一起并被抛入一个字符串变量中,我将用它来替换多值字段关键字。对于那个特定记录。它的另一部分是在加载表单的实例中,我想解析当前的关键字。字段(使用逗号作为分隔符)到8个现有的组合框中。用户甚至不需要看到关键字。字段,因为他们只是使用8个框作为界面来编辑关键字字段。字段。


论坛的记录源基于[问题]表格


任何帮助都会被评估,


谢谢,

I have a "Questions" form that reads off of a table and contains a multi-value field called "Keywords". I already know that having a multi-value field is a horrible idea, however, I am patching up a few things in a database I did not create and there are other factors involved in my need to keep that particular multi-valued field. What I would like to do is have 8 drop down boxes on the side that call in a list of keywords from another table.
I want an update button that, when clicked and for a particular record, the keywords from the 8 drop down boxes would be concatenated together with commas between them (7 commas in total) and thrown into one string variable which I will use to replace the multi-value field "Keywords" for that specific record. The other part of it is that at the instance of loading the form, I want to parse the current "Keywords" field (using the comma as the delimiter) into the 8 existing combo boxes. The user will not even need to see the "Keywords" field, because they will just be using the 8 boxes as an interface to edit that "keywords" field.

The recordsource for the forum is based on a [Questions] Table

Any help would be apprciated,

Thanks,

推荐答案

1。通过将index属性设置为0到7来创建8个下拉框的数组会很不错。


2.分割sKeywords使用以下代码。

[PHP] Dim arr,i


arr = Split(sKeywords,",")


for i = 0 To UBound(arr)

DropDown(i)= arr(i)

下一页[/ PHP]


3.收集从所有方框返回的数据


[PHP] sKeywords =""


对于i = 0到7

sKeywords = sKeywords& IIF(sKeywords ="","",",")& DropDown(i).Text

下一页[/ PHP]


好​​运
1. It would be nice to create array of 8 drop down boxes by setting index property to each from 0 to 7.

2. to split sKeywords use following code.
[PHP]Dim arr, i

arr = Split(sKeywords, ",")

For i = 0 To UBound(arr)
DropDown(i) = arr(i)
Next[/PHP]

3. To collect data back from all boxes

[PHP]sKeywords = ""

For i = 0 to 7
sKeywords = sKeywords & IIF(sKeywords = "", "", ",") & DropDown(i).Text
Next[/PHP]

Good Luck



1.通过将index属性设置为0到7,创建8个下拉框的数组会很不错。
1. It would be nice to create array of 8 drop down boxes by setting index property to each from 0 to 7.



我不喜欢不认为Access支持控制数组。 MS似乎非常热衷于摆脱它们 - 将它们从VBA中移除,在VB.Net中删除它们......


如果你快速搜索TheScripts,你可以查找Microsoft的文章链接,了解如何模拟控件数组。 (加上我自己的技术,当然是​​优越的。)))

I don''t think Access supports control arrays. MS seem to have been quite keen to get rid of them - removed them from VBA, removed them in VB.Net...

If you do a quick search on TheScripts, you can find links to an article at Microsoft on how to simulate a control array. (Plus my own technique which is far superior, of course.:))



我不认为Access支持控制数组。 MS似乎非常热衷于摆脱它们 - 将它们从VBA中移除,在VB.Net中删除它们......


如果你快速搜索TheScripts,你可以查找Microsoft的文章链接,了解如何模拟控件数组。 (加上我自己的技术,当然是​​优越的。:))
I don''t think Access supports control arrays. MS seem to have been quite keen to get rid of them - removed them from VBA, removed them in VB.Net...

If you do a quick search on TheScripts, you can find links to an article at Microsoft on how to simulate a control array. (Plus my own technique which is far superior, of course.:))



你认为它是Access ..... mmmmmmmmmmmm


You think it is Access..... mmmmmmmmmmmm


这篇关于通过表单解析表字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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