根据单独表中的字段在表单的绑定字段上设置值 [英] Set a Value on a form's bound field based on field in separate table

查看:103
本文介绍了根据单独表中的字段在表单的绑定字段上设置值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用附加数据库。打开表格DH添加订单含税。我想自动填充绑定控件INVNUM。它的来源是表INVOICE中的字段INVNUM。

我希望使用SetValue宏,使用DMAX表达式来设置值。

问题是INVOICE包含一些超过900,000的非常旧的INVNUM。我想拿起当前INVNUM在46822结束的地方,所以我的下一个INVNUM将是46823.

我想我需要在我的表达式中结合Where语句,但我不知道该怎么做。

本质上它会说,在表格上设置INVNUM的值,其值大于表INVOICE中最大的INVNUM,低于900,000。

Any建议?

谢谢



附加档案
测试数据库II.zip (254.1 KB,115 views)

解决方案

绑定表单的数据源是什么?

显示发票号的控件名称是什么?


技巧涉及设置控件的默认值,以便仅使用它d如果数据被添加到表单中。


@NeoPa


表格问题绑定到查询DH INVOICE查询(也许我应该更改它并将表单直接绑定到表INVOICE?)。表格上的控件是INVNUM。

感谢您的继续帮助。


您仍然可以使用INVOICE表格。

展开 | 选择 | Wrap | 行号

Using attached database. Open Form "DH ADD ORDERS w/Tax". I would like to autopopulate the bound control "INVNUM". It''s source would be the field INVNUM in the table INVOICE.
I was hoping to use a SetValue Macro, using a DMAX expression to set the value.
Problem is that INVOICE contains some very old INVNUM above 900,000. I want to pick up where the current INVNUM end at 46822, so my next INVNUM would be 46823.
I think I need to couple a Where statement in my expression, but am not sure how to do it.
In essence it would say, "Set Value of INVNUM on the form at a value one greater than the greatest INVNUM in the Table INVOICE that is below 900,000.
Any suggestions?
Thanks

Attached Files
TEST DB II.zip (254.1 KB, 115 views)

解决方案

What data source is the form bound to?
And what is the name of the control where the invoice number is displayed?

The trick involves setting the Default value of the control, so that it is only used if data is added to the form.


@NeoPa
The form in question is bound to the a query DH INVOICE Query (perhaps I should change this and bind the form directly to the Table INVOICE?). The control on the form is INVNUM.
Thanks for your continuing assistance.


You can probably use the INVOICE table anyway for this.

Expand|Select|Wrap|Line Numbers


这篇关于根据单独表中的字段在表单的绑定字段上设置值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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