[英]How do I update a field on a form based on another entered field in Access 2013?
[英]How to make a field required in Microsoft Access form based on the criteria of another
表單名稱:Inventory_Adjustments
欄位1:已調整數量
欄位2:Approved_By
您好,我正在嘗試實現以下目標,但無法弄清楚如何實現。
-用戶輸入的Qty_Adjusted值小於3,不需要Approved_By。
-用戶輸入Qty_Adjusted等於3,需要Approved_By並顯示消息“尋求1級批准”。
-用戶輸入Qty_Adjusted在3到10之間調整,需要Approved_By並顯示消息“尋求2級批准”。
-用戶輸入Qty_Adjusted大於10,需要Approved_By,並顯示消息“尋求3級批准”。
基本上,您將在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
在每個部分中適當顯示錯誤/消息,然后中止更新。 否則,讓更新正常進行。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.