Update Table From Form

  • Thread starter Thread starter Paul Murphy via AccessMonster.com
  • Start date Start date
P

Paul Murphy via AccessMonster.com

Hi Folks,

Could anyone tell me how to update a table from a form. I have both the
table and the form but need to know how to do the update using a button.

Thanks in advance,

Paul
 
I found this most perplexing for a long time. The way I got round it
initially was to create another form linked to the table then fill the dater
inot that form and close it again.

This was rather cumbersome, so now, I open the table as a dataset and add
the data to the dataset. this is much more elegent but it takes a lot of
trial and error to write the correct SQL statement. The best way to do this
is to greate a query that does what you want then look at the SQL statement
in that query.
 
Access will save the data in you form automatically when you move from one
record to another or when you close the form. If the form isn't saving you
data make sure that the form is based on the table or a query that is based
on the table. Look at the form in design view and check the form properties.
The record source should show the table name or a query based on the table.

If you want a command button to do the job you can enter the following code
on the OnClick event for the button:

DoCmd.RunCommand acCmdSaveRecord
 
Back
Top