将值设置为新行中的字段以匹配表单中的最后一行 [英] Setting a value to a field in a new row to match the last row in a form

查看:68
本文介绍了将值设置为新行中的字段以匹配表单中的最后一行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好


似乎是一个简单的问题,但我是VBA中的新手。

我有一个包含资源列表的表单,我想要设置其中一个字段(类型)的值,以便在单击新行按钮时匹配上一行中的相同字段。


任何想法?

Hello

Seems to be an easy problem but I am a newbee in VBA.
I have a form with a list of resources, I want to set the value of one of the fields (type) to match the same field in the previous row when clicking on a new row button.

Any ideas ?

推荐答案

你需要默认吗?或者Ctrl-''你呢?


将数据输入数据表(这在Excel和Access中都有效)按住Ctrl键同时点击''(Ctrl-'')复制上面单元格中的值。
Do you need this to default? Or would Ctrl-'' do you?

When entering data into a datasheet (This works in Excel as well as Access) hold down Ctrl while tapping '' (Ctrl-'') to replicate the value from the cell above.


@NeoPa


有没有在创建新记录时自动对特定字段执行此操作的方法吗?
@NeoPa
is there a way to do this to specific fields automatically when creating a new record ?


问题是这些记录是否在单个会话中输入,即打开的表单,然后是一个接一个的记录进入后,等等。如果是这样,使用hack为字段设置 DefaultValue ,就像NeoPa所提到的那样,是要走的路。


一个例子就是
The question is whether these records are being entered in a single session, i.e. the form being opened, then one record after another after another, etc, being entered. If so using a hack that sets the DefaultValue for the field, as NeoPa alluded to, is the way to go.

An example of that would be
展开 | 选择 | Wrap | 行号


这篇关于将值设置为新行中的字段以匹配表单中的最后一行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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