Save a record after update

G

Guest

Hello.
I would like to add code to each field in a record so that after adding new
data or updating data in any field the record will be forced to save, for
example if I have the following fields installdate, installdescription and
installnotes and I add info or update info in any one of these fields as soon
as I am done I need the record to save. How would I write this?.
docmdme.save
 
S

Stuart McCall

Iram said:
Hello.
I would like to add code to each field in a record so that after adding
new
data or updating data in any field the record will be forced to save, for
example if I have the following fields installdate, installdescription and
installnotes and I add info or update info in any one of these fields as
soon
as I am done I need the record to save. How would I write this?.
docmdme.save

Either:

Me.Dirty = False

or:

DoCmd.RunCommand acCmdSaveRecord
 
G

Guest

Stuart. Thanks for your reply.
I am having a little bit of a problem.

I have a continuous form (main) with three fields and on each record I have
a button to open a subform.
The problem is when I type in a new record on the continuous form (main) and
I click on the button to open the subform and after I input data into a
record on the subform I get an error saying that there is no related record
on the (main) form. If I go back to the main form I can see that there is a
pencil still writing next to the record. I was hoping that the code you wrote
earlier would for the pencil to save but its not. Not even when I click on
File, Save. The pencil still stays there. The only way I can get it to save
is by clicking on a different record. How do I mitigate this?

Thanks.
Iram/mcp
 
S

Stuart McCall

Iram said:
Stuart. Thanks for your reply.
I am having a little bit of a problem.

I have a continuous form (main) with three fields and on each record I
have
a button to open a subform.
The problem is when I type in a new record on the continuous form (main)
and
I click on the button to open the subform and after I input data into a
record on the subform I get an error saying that there is no related
record
on the (main) form. If I go back to the main form I can see that there is
a
pencil still writing next to the record. I was hoping that the code you
wrote
earlier would for the pencil to save but its not. Not even when I click on
File, Save. The pencil still stays there. The only way I can get it to
save
is by clicking on a different record. How do I mitigate this?

Hmm. Is your continuous form based on a query? If so, is the query
updateable (ie can you open the query from the database window and enter or
edit data?). I ask this because normally Access will save the current record
as soon as you leave it by moving focus to the subform.

Can you click File -> Save successfully without entering the subform?
 

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

Top