AfterUpdate is fired before the modification in the access database -
on ms access 2003, have data bounded table 1 true/false column named selection can check.
i need update textbox count of selected item. (selection = true)
when use afterupdate event of checkbox, noticed modification in dabase wasn't effective have wrong number of selected item (when check 1 line, have count - 1, when uncheck, have count + 1)
do know workaround ?
i tryied :
nombreselections = dcount("*", "tmpselectionpalette", "selection = true") if (selection.value) nombreselections = nombreselections + 1 else nombreselections = nombreselections - 1 end if
but trick doesn't work, have count, not
if you're going use dcount()
, want count update after click checkbox need set form's .dirty
property false
commit (write) change table. is, need this:
private sub chkselection_afterupdate() me.dirty = false '' commit changes me.txtselectedcount.value = dcount("*", "clients", "selection") end sub
Comments
Post a Comment