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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Open a filter and default value 1
#Name? 2
Open a form 1
Field Name in Cross Tab Query 3
Simple question on forms 4
Filter based on OptionBoxes 1
Update Two Tables Using One Form Contents 0
Separate Form 0

Back
Top