基于另一个Combobox的自动填充组合框(Access 2007) [英] Autofill Comboboxes Based on Another Combobox (Access 2007)

查看:114
本文介绍了基于另一个Combobox的自动填充组合框(Access 2007)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有数据输入表单,其中很少有名为city,dist,state的组合框。所以我想自动填充dist,状态组合框在城市组合框中增加价值。请帮助我。

I Have data entry form in which there are few comboboxes named as city,dist,state. so i want to autofill the dist, state comboboxes on adding value in city combobox. please help me.

推荐答案

将要自动填充的列添加到City组合框的RowSource中。


更改City AfterUpdate事件中的ColumnCount和ColumnWidths属性


,在其他控件中设置值。


这是您可以修改的一些代码:

Add the columns you want to automatically fill to the RowSource for the City combobox.

Change the ColumnCount and ColumnWidths properties

on the City AfterUpdate event, set the values in the other controls.

Here is some code you can modify:

展开 | 选择 | Wrap | 行号


如何为行 - 源,绑定列和控件 - 设置组合框来源?


如果受到约束,并在after_update事件中的规范化数据库中进行设置(如S4P所述)您需要设置[controlname] .value以匹配相关表字段的值。你可能还需要 me.repaint 来获取表格进行更新。
How are your comboboxes setup for the row-source, bound-column, and control-source?

IF these are bound, and setup in a normalized database, in the after_update event (as S4P has mentioned) you need to set the [controlname].value to match the value of the related table field. You might also need to me.repaint to get the form to update.


我经常做海报正在做的事......我有一张42,000多个邮政编码表,用于填写城市和州。


参考数据库包含邮政编码,国家,州,地区代码,航空公司,机场,...电压,鲜花,...
http://www.AccessMVP.com/strive4peace/Reference.htm


我确实尝试存储FK而不是城市,州和邮政编码的值,但是速度非常慢,使搜索和过滤更加困难......所以现在我将文本和自动填充存储在zip上,因为我的拉链表是并不总是对的。这节省了我输入地址的时间,让我更正了查找的值。
I often do what the poster is doing ... have a table of 42,000+ zip codes that I use to fill city and state.

Reference Database with Zip Codes, Countries, States, Area Codes, Airlines, Airports, ... voltages, flowers, ...
http://www.AccessMVP.com/strive4peace/Reference.htm

I did try storing FKs instead of values for city , state, and zip but it was incredibly slow and made searching and filtering more difficult ... so now I store text and autofill on zip because my zips table is not always right. This saves me time entering addresses and lets me correct the looked-up values.


这篇关于基于另一个Combobox的自动填充组合框(Access 2007)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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