Update Table from Form

  • Thread starter Thread starter margaret
  • Start date Start date
M

margaret

I have a very simple table ... tblControlFile and I have a form
frmSwitchboard that has an underlying query qryControlFile. When I change
the date ("fairdate")on frmSwitchboard, it is not changing the date on the
tblControlFile until I exit the form and come back into it. I would like the
date to update the table on exit of the control.

I know this is simple but I can't seem to find the answer in all the posted
questions and would hope some one could help me.
 
Records do not update until you finish them. You can force an update though
in the AfterUpdate event of the control (untested):

Sub fairdate_AfterUpdate()
DoCmd.RunCommand acCmdSaveRecord
End Sub

This will fail if you have any required fields in the table which haven't
been saved as well.
 
Thanks so much ... that worked perfectly!!

Arvin Meyer said:
Records do not update until you finish them. You can force an update though
in the AfterUpdate event of the control (untested):

Sub fairdate_AfterUpdate()
DoCmd.RunCommand acCmdSaveRecord
End Sub

This will fail if you have any required fields in the table which haven't
been saved as well.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
 
Back
Top