我可以更改现有数据的行源绑定列 [英] Can I change the rowsource bound column for existing data

查看:53
本文介绍了我可以更改现有数据的行源绑定列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有数字和文本字段的问题。

我得到了包含许多组合框的数据库文件(mdb)和

其列表值是由值列表

例如字段


字段名称=''家具'',数据类型='''数字'',显示控制=' '组合

Box'',RowSource Type =''Value List''和

Row Source =''0;" chair" ;; 1;" Table" ; 2;"床和QUOT; ''


因此,在表的数据表视图中,如果我们选择(1:表),

则值1存储在家具字段中。


我想将此字段''furniture''的数据类型更改为''Text''和

将数据作为相关文本''对于所有数据,表''而不是''1'

记录输入。


有没有办法转换所有记录?请!!!!!!!!!!!帮助我

i有成千上万的记录来改变这些字段从''数字'到

对应的''文字''


尽快等待你的回复,

NYT

解决方案

你真的想这样做吗? ?

你可能有一张家具桌看起来像:

TblFurniture

FurnitureID

FurnitureItem

每个家具项目都由唯一的FurnitureID标识。


在数据库的某个地方你有另一张桌子,其中FurnitureID是一个

外键也许是房子内容表看起来像:

TblHouseContents

HouseContentID

FurnitureID



在此表中,家具物品由其FurnitureID记录而不是

其名称。这是在关系数据库中执行此操作的正确方法。所以

用于数据输入到此表中,您的表单需要一个组合框来选择

家具项目。由于该表,组合框的值必须是

数(FurnitureID)。因此,您的价值清单是正确的。


如果您的数据库是这样或者设计不同,请告诉我们。

-

PC数据表

您的资源以获取Access,Excel和Word应用程序的帮助
重新* *****@pcdatasheet.com
www.pcdatasheet.com


超过1000个Access用户来找我帮忙。我的费用非常合理。


" nyt" < NA ***** @ gmail.com>在消息中写道

news:11 ********************** @ z14g2000cwz.googlegr oups.com ...

我有数字和文本字段的问题。
我得到了包含许多组合框的数据库文件(mdb),并且其列表值是由值列表创建的。 />对于例如字段

字段名称=''家具'',数据类型='''数字'',显示控制=''组合
框'',RowSource类型=''值列表''和
行源=''0;" chair" ;; 1;" Table"; 2;" Bed" ''

因此,在表的数据表视图中,如果我们选择(1:表),那么值1将存储在家具领域。

我想将此字段''furniture''的数据类型更改为''Text''和
要为所有数据添加文本''Table''而不是''1'的数据
输入的记录。

有没有办法改变所有记录?请!!!!!!!!!!!帮助我
我有成千上万的记录将这些字段从''数字'改为
相应的''文字''

等待你尽快回复,
NYT



我的数据库没有针对每个组合的单独表格。

所有组合选择列表值均由行中的一个字符串

来源如我所述,(行来源=''0;椅子; 1;表格; 2;床''),

绑定列= 1,计数列= 2


i通过将绑定列更改为1来尝试,但它不适用于

现有数据,只有新的委托数据才可以。


i有大约70个这样的组合要改变。


因此,如果是另一种解决方法,请!!!!!!!!!!!!!!!!!

问候,

nyt

1。在现有表中添加新字段。将它命名为(例如)FurnitureTypeID。它

可以是一个文本字段,并将其字段大小属性设置为足够的

(可能是24或40个字符。)保存表格。


2.要填充此新字段,请在此表中创建查询。将其更改为

更新查询(在查询设计视图中更新查询菜单。)Access将

更新行添加到网格中。


3.将Furniture字段拖到网格中。

在此字段下的Criteria行中输入:

0


4.将FurnitureTypeID字段拖到网格中。在

此字段下的Criteria行中,输入:

Null

在此字段下的更新行中,输入:

" chair"

5.点击工具栏上的感叹号图标运行查询。


6.返回设计视图,将家具下的标准更改为:

1

和FurnitureTypeID下的更新行:

" table"

再次运行查询。


7.对其他值重复步骤6.


8.之后验证所有条目都是正确的,您可以删除

原始家具字段。


为了使以后的任务更容易,这将是一个好主意创建一个

表来保存所有有效值,并将其用作

组合的源。要做到这一点:

1.创建一个名为(比如)FurnitureType的新表,其中一个文本字段名为

FurnitureTypeID。


2.在原始表中创建一个查询,只选择

FurnitureTypeID字段。在此字段下的Criteria行中,输入:

不为空


3.在属性框(视图菜单)中,设置查询'' Unique Values属性

为是。


4.将其更改为追加查询(追加查询菜单)。

Tell要添加到FurnitureType表的访问权限。


5.运行查询。该表现在包含有效选项。


6.在工具菜单上选择关系,并将两个表添加到

屏幕。然后将FurnitureTypeID从FurnitureType表拖到另一个表中匹配的FurnitureTypeID字段的

上。当你放手时,Access

会弹出Create Relation对话框。选中关系完整性框,

和确定对话框。


现在可以确保列表中只显示有效值,但它是

比值列表更容易维护。

-

Allen Browne - 微软MVP。西澳大利亚州珀斯。

访问用户提示 - http:// allenbrowne.com/tips.html

回复群组,而不是mvps dot org的allenbrowne。


" nyt" < NA ***** @ gmail.com>在消息中写道

news:11 ********************** @ z14g2000cwz.googlegr oups.com ...

我有数字和文本字段的问题。
我得到了包含许多组合框的数据库文件(mdb),并且其列表值是由值列表创建的。 />对于例如字段

字段名称=''家具'',数据类型='''数字'',显示控制=''组合
框'',RowSource类型=''值列表''和
行源=''0;" chair" ;; 1;" Table"; 2;" Bed" ''

因此,在表的数据表视图中,如果我们选择(1:表),那么值1将存储在家具领域。

我想将此字段''furniture''的数据类型更改为''Text''和
要为所有数据添加文本''Table''而不是''1'的数据
输入的记录。

有没有办法改变所有记录?请!!!!!!!!!!!帮助我
我有成千上万的记录将这些字段从''数字'改为
相应的''文字''

等待你尽快回复,
NYT



I have a problem of number and text field.
I got the database file(mdb) that contains many combo boxes used and
its list values are created by "value list"
For eg field

Field name= ''furniture'' , data type=''Number'' ,Display Control=''Combo
Box'', RowSource Type = ''Value List'' and
Row Source = '' 0;"chair";1;"Table";2;"Bed" ''

Therefore, in data sheet view of table, if we select (1 : Table ) ,
then the value 1 is stored in furniture field.

I want to change the data type of this field ''furniture'' to ''Text'' and
the data to be assoiated text ''Table'' instead of ''1'' for all data
records entered.

Is there any way to transform all records? please!!!!!!!!!!! help me
i haeve thousands of records to change such fields from ''number'' to
corresponding ''text''

Waiting ur reply as soon as possible ,
NYT

解决方案

Do you really want to do this?
You probably have a furniture table that looks like:
TblFurniture
FurnitureID
FurnitureItem
Each furniture item is identified by a unique FurnitureID.

Somewhere in your database you have another table where FurnitureID is a
foreign key Perhaps a house contents table that looks like:
TblHouseContents
HouseContentID
FurnitureID
etc

In this table, furniture items are recorded by their FurnitureID and not
their name. This is the correct way of doing it in a relational database. So
for data entry into this table, your form needs a combobox to select the
furniture item. Because of the table, the value of the combobox must be a
number (FurnitureID). Therefore your Value List is correct as is.

Let us know if your database is like this or is designed differently.
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com

Over 1000 Access users have come to me for help. My fees are very
reasonable.

"nyt" <na*****@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...

I have a problem of number and text field.
I got the database file(mdb) that contains many combo boxes used and
its list values are created by "value list"
For eg field

Field name= ''furniture'' , data type=''Number'' ,Display Control=''Combo
Box'', RowSource Type = ''Value List'' and
Row Source = '' 0;"chair";1;"Table";2;"Bed" ''

Therefore, in data sheet view of table, if we select (1 : Table ) ,
then the value 1 is stored in furniture field.

I want to change the data type of this field ''furniture'' to ''Text'' and
the data to be assoiated text ''Table'' instead of ''1'' for all data
records entered.

Is there any way to transform all records? please!!!!!!!!!!! help me
i haeve thousands of records to change such fields from ''number'' to
corresponding ''text''

Waiting ur reply as soon as possible ,
NYT



No my database has no separate tables for each combo.
all the combo select list values are control by just a string in Row
Source as i stated , ( Row Source = '' 0;"chair";1;"Table";2;"Bed" '' ) ,
bound column = 1 , Count Column = 2

i tried by changing the bound column to 1, but it is not OK for
existing data, and only OK for new entriy data.

i have about 70 such combos to change.

Therefore, if another way of solution, PLEASE!!!!!!!!!!!!!!!!!

with regards,
nyt


1. Add a new field to your existing table. Name it (say) FurnitureTypeID. It
can be a text field, and set its Field Size property to whatever is enough
(perhaps 24 or 40 characters.) Save the table.

2. To populate this new field, create a query into this table. Change it to
an Update query (Update on Query menu, in query design view.) Access adds an
Update row to the grid.

3. Drag the Furniture field into the grid.
In the Criteria row under this field enter:
0

4. Drag the FurnitureTypeID field into the grid. In the Criteria row under
this field, enter:
Is Null
In the Update row under this field, enter:
"chair"

5. Run the query, by clicking the exclamation icon on the toolbar.

6. Back to design view, change the Criteria under Furniture to:
1
and the Update row under FurnitureTypeID to:
"table"
Run the query again.

7. Repeat step 6 for the other values as well.

8. After verifying that all the entries are correct, you can delete the
original Furniture field.

To make the task much easier later, it would be a good idea to create a
table to hold all the valid values, and use that as the source for the
combo. To do that as well:
1. Create a new table named (say) FurnitureType, with one Text field named
FurnitureTypeID.

2. Create a query into your original table, selecting just the
FurnitureTypeID field. In the Criteria row under this field, enter:
Is Not Null

3. In the Properties box (View menu), set the query''s Unique Values property
to Yes.

4. Change it to an Append query (Append on Query menu).
Tell Access you want to append to the FurnitureType table.

5. Run the query. The table now contains the valid choices.

6. Choose Relationships on the Tools menu, and add both tables to the
screen. Then drag FurnitureTypeID from the FurnitureType table onto the
matching FurnitureTypeID field in the other table. When you let go, Access
pops up the Create Relation dialog. Check the box for Relational Integrity,
and Ok the dialog.

You are now assured that only valid values can appear in the list, but it is
much easier to maintain than the value list.
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"nyt" <na*****@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...

I have a problem of number and text field.
I got the database file(mdb) that contains many combo boxes used and
its list values are created by "value list"
For eg field

Field name= ''furniture'' , data type=''Number'' ,Display Control=''Combo
Box'', RowSource Type = ''Value List'' and
Row Source = '' 0;"chair";1;"Table";2;"Bed" ''

Therefore, in data sheet view of table, if we select (1 : Table ) ,
then the value 1 is stored in furniture field.

I want to change the data type of this field ''furniture'' to ''Text'' and
the data to be assoiated text ''Table'' instead of ''1'' for all data
records entered.

Is there any way to transform all records? please!!!!!!!!!!! help me
i haeve thousands of records to change such fields from ''number'' to
corresponding ''text''

Waiting ur reply as soon as possible ,
NYT



这篇关于我可以更改现有数据的行源绑定列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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