如何根据另一个条件在 Microsoft Access 表单中创建必填字段

How to make a field required in Microsoft Access form based on the criteria of another

表格名称:Inventory_Adjustments

字段一:Qty_Adjusted

字段二:Approved_By

您好,我正在努力实现以下目标,但不知道如何实现。

-用户输入 Qty_Adjusted 小于 3 的值,不需要 Approved_By。

-用户输入 Qty_Adjusted 等于 3,Approved_By 需要消息“seek 1级批准。

-用户输入 Qty_Adjusted 介于 3 和 10 之间,消息需要 Approved_By "seek level 2 approval".

-用户输入 Qty_Adjusted 大于 10,消息需要 Approved_By "seek level 3 approval".

基本上您要检查 Before_Update 事件中的 Qty_Adjusted 字段。

那么您可能会为每个条件创建一个嵌套的 if 或一个 if-then-else 链。伪代码:

If less than three, do nothing
else if equal to 3 then check the value of `Approved_By` is at least 1
else if less than 10 then check the value of `Approved_By` is at least 2
else then check the value of `Approved_By` is at least 3

根据需要在每个部分显示 errors/messages,然后中止更新。 否则,让更新正常进行。