MS Access 获取更新的行 ID 或拦截更新
MS Access get row ID of Update or intercept Update
简短版本:
I have an access table that has a Yes/No column called [Accepted]
that I want flipped to "No" anytime an update happens to that row. How can
I do this? I've been working with Form_AfterUpdate
in VBA but no luck
so far.
长版:
I'm trying to get CRUD working with my OLTP back-end SQL SERVER using
Access. I'm exploring the possibility of using Access as a
simple front end for office work but want it to jive with our larger data operation. I've designed a Main Form with
Edit
, Cancel
, Save
, and Refresh
buttons. In the body of that
form I've embedded a Sub-form containing a datasheet. My Edit
button unlocks the sheet in the Sub-form for insert and delete. This
Sub-form is bound to a local access table which serves as a cash.
The Refresh
button rebases my Access table/cache with the OLTP server and
the Save
button writes any records in my Access table/cache marked
as [Accepted]=No
to the OLTP server and then refreshes.
任何关于我如何更好地使 CRUD 与 OLTP 和 Access 一起工作的建议都将受到赞赏,因为这是这里的全部目标。但是,如果我能弄清楚如何截取或获取更新行的记录 ID,我想我自己已经很接近了。
使用Form_BeforeUpdate事件:
Me!Accepted.Value = False
简短版本:
I have an access table that has a Yes/No column called
[Accepted]
that I want flipped to "No" anytime an update happens to that row. How can I do this? I've been working withForm_AfterUpdate
in VBA but no luck so far.
长版:
I'm trying to get CRUD working with my OLTP back-end SQL SERVER using Access. I'm exploring the possibility of using Access as a simple front end for office work but want it to jive with our larger data operation. I've designed a Main Form with
Edit
,Cancel
,Save
, andRefresh
buttons. In the body of that form I've embedded a Sub-form containing a datasheet. MyEdit
button unlocks the sheet in the Sub-form for insert and delete. This Sub-form is bound to a local access table which serves as a cash. TheRefresh
button rebases my Access table/cache with the OLTP server and theSave
button writes any records in my Access table/cache marked as[Accepted]=No
to the OLTP server and then refreshes.
任何关于我如何更好地使 CRUD 与 OLTP 和 Access 一起工作的建议都将受到赞赏,因为这是这里的全部目标。但是,如果我能弄清楚如何截取或获取更新行的记录 ID,我想我自己已经很接近了。
使用Form_BeforeUpdate事件:
Me!Accepted.Value = False