Create Reocrd of data in form on button click

RECrerar

Registered User.
Local time
Today, 12:11
Joined
Aug 7, 2008
Messages
130
Hi,

This is porbably really simple.

I need to force the update of information that has been entered into a form so that it is saved into a table (tblAnnualPT) from a button click. That is the button click does the same as moving away from the record and then moving back.

This is because the code behind the button adds records to a table ((tblWeeklyPT) that is then used to populate a subform) that requires a ProjectYearID which is only created after the data on the mainform is updated, so currently when I enter the data into the form and click the command button ([cbAddForcast]) the code bugs as it requires a corresponding record in tblAnnualPT which hasn't yet been created.

I'm sure this must be something really simple like me.update or something but am a bit stuck.

Thanks, Robyn
 
One way:

DoCmd.RunCommand acCmdSaveRecord
 
Don't worry

My first search didn't bring up anything, but a bit more digging about and I found it.

Code:
If Me.Dirty Then Me.Dirty = False

Thanks anyway

PS. Thanks pbaldy, didn't see your responce when I first replied. Thanks for your option. Is there any advantage in using that over the method I found?
 
Last edited:

Users who are viewing this thread

Back
Top Bottom