如何根据另一个文本框中的数据填充文本框? [英] How do I populate a text box based on the data in another text box?

查看:96
本文介绍了如何根据另一个文本框中的数据填充文本框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的表单上有一个区域代码。该区域代码基于邮政编码。输入邮政编码后,我将使用什么代码让程序查找区域代码。我已经有一个表将邮政编码分解到他们的区域。

解决方案

我会在Zipcode的AfterUpdate事件上写一些VBA代码,这样做基于ZipCode的 DLookUp ,然后为区域字段分配值。


示例:

展开 | 选择 | Wrap | 行号


这是代码我''但是它不喜欢最后的我.HOME_ZIP.Value。我做错了什么?

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


展开 | 选择 | 换行 | 行号

I have a form that has a region code on it. That region code is based on the zip code. What code would I use to have the program lookup the region code once the zip code has been entered. I already have a table that has the zip codes broken down into their regions.

解决方案

I would write some VBA code on the AfterUpdate event of the Zipcode, that would do a DLookUp based on the ZipCode, then assigns a value to the region field.

Example:

Expand|Select|Wrap|Line Numbers


Here''s the code I''ve got but it doesn''t like the last me.HOME_ZIP.Value. What did I do wrong?

Expand|Select|Wrap|Line Numbers


Expand|Select|Wrap|Line Numbers


这篇关于如何根据另一个文本框中的数据填充文本框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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