通过顺序的文本场访问vba-loop,如果不是空的,请执行
我需要一些帮助来优化数据输入的访问表格。在我的表格上,我中有许多不同的字段是7个文本字段。我想循环通过其中的6个,我依次命名,如果它们不是空的,请做某事。我正在使用Access VBA
尝试在伪代码中显示:
for i = 1 to 6
if hardness_measurement_i > 0 then
<do something>
else
<do nothing>
end if
next i
我的问题是制定了循环的这一部分:“ hardness_measurement_i”
是否有一个很好的方法可以依次遵循命名的表单字段?
I need some help to optimize an access form for data entry. On my form I have many different fields amongst them are 7 text fields. I would like to loop through 6 of these which I have named sequentially and do something if they are not empty. I am using access VBA
Tried to show in pseudo code:
for i = 1 to 6
if hardness_measurement_i > 0 then
<do something>
else
<do nothing>
end if
next i
My problem is formulating this part of the loop: "hardness_measurement_i"
Is there a good way to loop through form fields named sequentially?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试使用
Controls
收集表单的属性来获取contol。要检查文本框是否为空,您可以调用
isnull()
方法传递控件的value
。Try to get the contol by name using the
Controls
collection property of the form.To check if the textbox is empty, you can call the
IsNull()
method passing the control'sValue
.