Update current record

trebor3900

Registered User.
Local time
Today, 20:50
Joined
Apr 26, 2005
Messages
47
I am a relative Newbie so if my question sounds stupid, bear with me:

I have a form with a subform linked to a query.

On the subform i have a checkbox[Recieved] and when checked adds a date to
another field [Year] on the subform which in turn updates the record in a table[Orders].

I then click a command button on the form which runs a crosstab query based on the
updated fields in the table [Orders].

This works well except for the last record ammended which does not update the [Year]
field in the table [Orders]. When the command button is clicked it is still the current
record in the subform.

clicking another record in the subform solves this or closing the form and reopening it before running the crosstab query.

Is there an easier way to automate the update? So that the user does not have to select another record first.
 
Force current edits to be saved to the table using either of...
DoCmd.RunCommand acCmdSaveRecord 'I think
or...
Me.Refresh
 
tried both

Tried both methods from previous posts. Ok to update the subform but not the updated table with the last edited record.

Clicking another record or closing and reopening the form is the only thing that has worked..:-(
 
You might want to do a refresh after the query finishes, this should force the record to be temporarily released and act as if you switched to another record and back. Add docmd.runcommand.accmdrefresh at the end of your procedure.
 
Thanks for taking the time to answer guys, but i attacked the problem from a different direction. I ran an update query from the click event of the checkbox. This seems to work better.

Cheers for your time anyway
 

Users who are viewing this thread

Back
Top Bottom