请帮助:只需要从组合框中捕获数据以更新表 [英] Please help: simply need to capture data from combo box to update table

查看:46
本文介绍了请帮助:只需要从组合框中捕获数据以更新表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,我对使用变量相对较新。我的大部分经验都是界面设计。我正在使用ACCESS ver。 2003年,在Windows XP中运行。


其次,我花了一个小时搜索文章和帖子,以确保我所寻找的信息尚未在网站上发布。


我正在靠墙试图弄清楚看起来应该很简单的东西。问题是我不完全理解变量如何在控件中工作。


简单地说 - 我有一个包含3个对象的表单 - 一个组合框(未绑定),一个文本框(未绑定) )和一个命令按钮。我有一个带有下拉列表的组合框设置,用于读取主表中日期字段的值。


我需要做什么:


用户将单击组合框旁边的下拉列表,然后从列表中选择一个日期。


接下来,用户将键入一个新的日期到文本框。


然后,当用户单击命令按钮时 - 表中存在的等于组合框中的值的日期值将被新的覆盖来自文本框的价值。


应该很容易,但我已经投入了大约10个小时才能使这种情况失败。


表名:sponprod

要修改的字段:prod_date

表格名称:rollforwardprevmonthdataform

列表框名称:List1

文本框名称:Text4

命令按钮:command16

我不明白如何为控件分配字符串值,如文本框,保存v alue,然后再打电话给它。


到目前为止,这是我想出来的。请帮助?!


代码:

展开 | 选择 | Wrap | 行号

解决方案

当您想要在加载的表单上检索控件的值时,语法为:

< span class =codeLinkonclick =Blur(this,this.parentNode.parentNode,getChildren(this),true);>展开 | 选择 | Wrap | 行号



如果要在加载的表单上检索控件的值,语法为:

展开 | 选择 | Wrap | 行号



是的,我使用了类似的语法:


Forms!rollforwardprevmonthdataform!List1


但是,我在这里错过了更大的图片。 />

它没有做任何事情。


我正在寻找一种使用该语法的简单方法,并实现我的目标:


- 从组合框中的下拉列表中选择日期

- 在文本框中键入新日期

- 单击命令按钮,以及来自从文本框中匹配值的表格由组合框中的值覆盖。


J.



我接近了看看你的代码。


让我们讨论一下范围。其中一些与你想要做的事情没有任何关系但是很高兴知道


表单模块中声明的任何函数或全局变量只能通过那种形式。函数中声明的任何变量只能由该函数访问。


可以使用绝对路径访问表单上的控件:

展开 | 选择 | Wrap | 行号

First, I am relatively new to working with variables. Most of my experience has been with interface design. i am using ACCESS ver. 2003, running in Windows XP.

Second, I spent an hour searching through articles and posts to make sure the information I am seeking is not already posted on the site.

I am beating my head against the wall trying to figure out something that seems like it should be very simple. The trouble is I do not fully understand how variables work within controls.

Simply put - I have a Form that contains 3 objects - a combo box (unbound), a text box (unbound), and a command button. I have the combo box set-up with a drop-down list to read values from a date field in the primary table.

What I need to do:

The user will click the drop-down next to the combo box, and select a date from the list.

Next, the user will type a new date into the text box.

Then, when the user clicks the command button - the date values that exist within the table that are equal to the value from the combo box will be overwritten with the new value from the text box.

Should be easy, yet I have already devoted about 10 hours to unsuccessfully making this happen.

Table Name: sponprod
Field to modify in table: prod_date
Form Name: rollforwardprevmonthdataform
List Box Name: List1
Text Box Name: Text4
Command button: command16

I do not understand how to assign a string value to a control, like a text box, save that value, and then call for it at a later time.

Here is what I have come up with, so far. PLEASE HELP?!

CODE:

Expand|Select|Wrap|Line Numbers

解决方案

When you want to retrieve the value of a control on a loaded form, the syntax is:

Expand|Select|Wrap|Line Numbers


When you want to retrieve the value of a control on a loaded form, the syntax is:

Expand|Select|Wrap|Line Numbers


Yes, I have used similar syntax:

Forms!rollforwardprevmonthdataform!List1

But, I am missing the bigger picture here.

It is not doing anything.

I am looking for a very simple way to use that syntax, and accomplish my goal:

- select date from drop-down in combo box
- type new date in to text box
- click command button, and values from table that match values from text box are written over by values from combo box.

J.

I took a closer look at your code.

Let''s have a discussion about scope. Some of this will not have any bearing on what you''re trying to do but it is good to know

Any function or global variable declared in a form module can only be accessed by that form. Any variable declared within a function can only be accessed by that function.

Controls on a form can be accessed using the absolute path:

Expand|Select|Wrap|Line Numbers


这篇关于请帮助:只需要从组合框中捕获数据以更新表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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