Update Table from Form

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.
 
A

Arvin Meyer [MVP]

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.
 
M

margaret

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

#Name? 2
Open a form 1
Simple question on forms 4
Where is Code for frmSwitchboard? 3
Update Table with Form Instantantly 7
Separate Form 0
re-useable validation rule 15
query before date 1

Top