且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将表单字段值分配给子表单中的所有记录

更新时间:2023-10-06 08:11:58

执行UPDATE语句,该语句的目标是包含在子表单中的相同记录.

Execute an UPDATE statement which targets the same records which are included in the subform.

您有一个带有WHERE子句的SELECT查询,该子句标识了子窗体的记录集中包含的记录.使用相同的WHERE子句构建UPDATE语句.例如,如果SELECT是...

You have a SELECT query with a WHERE clause which identifies the records included in the subform's recordset. Build an UPDATE statement using the same WHERE clause. For example, if the SELECT were ...

SELECT field1, field2
FROM YourTable
WHERE field2 = 'foo';

... UPDATE可能是...

... the UPDATE could be ...

UPDATE YourTable
SET field1 = 'new value'
WHERE field2 = 'foo';

使用DAO数据库对象的.Execute方法执行UPDATE语句.

Execute the UPDATE statement using the DAO database object's .Execute method.