Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ms-access/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ms access 2016年Ms Access中的DLookup功能_Ms Access_Vba_Ms Access 2016 - Fatal编程技术网

Ms access 2016年Ms Access中的DLookup功能

Ms access 2016年Ms Access中的DLookup功能,ms-access,vba,ms-access-2016,Ms Access,Vba,Ms Access 2016,给我 在系统中保存记录时 有人能告诉我这有什么问题吗 xx = DLookup("[part_number]", "tblModelCost", "[Customer_ID]= " & me.Customer_ID & " and [Model] = '" & me.[txtModel] & "' and [Description] = 'screen'") 看起来像我。客户Id应该是我!但是,这取决于表单控件名称和您尝试执行的操作。假设您有一个名为“Cust

给我

在系统中保存记录时

有人能告诉我这有什么问题吗

xx = DLookup("[part_number]", "tblModelCost", "[Customer_ID]= " & me.Customer_ID & " and [Model] = '" & me.[txtModel] & "' and [Description] = 'screen'")

看起来像我。客户Id应该是我!但是,这取决于表单控件名称和您尝试执行的操作。假设您有一个名为“Customer\u ID”的控件和一个名为“Customer\u ID”的字段Me.Customer\u ID将尝试使用控件值Me!Customer_ID将尝试使用基础绑定字段值。如果您没有名为Customer\u ID的控件,则使用Me.Customer\u ID将导致出现错误。(这就是为什么您希望学习在控件中使用诸如txtCustomer\u ID之类的控件名称。)

在OnChange事件中运行的代码太多了。尝试将其移动到AfterUpdate事件。