Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to save new data back to recordsource after auto fill form?

Status
Not open for further replies.

TTThio

Programmer
May 3, 2001
185
US
Hello,

In the form, I'm using recordset to calculate data. Then auto fill the form with that data by:

frm.value1 = MyValue1
frm.value2 = MyValue2, etc.

All these values are dipslayed in the form (datasheet view). However, when I preview report, the last record didn't show calculation result (if only one record, then there was no calculation result).

If I move the record selector then preview, complete data are shown. With this, I conclude that after filling up data in the form, the real data is still kept in the buffer, so the report (query as control source) cannot show the most updated data yet.

I've tried using DoCmd.RunCommand acCmdSaveRecord but it didn't work out. Is there another way to save the most updated data into the record source? Which event will be the best one to invoke?

I greatly appreciate your help.

Tin Tin
 
may be a bit sloppy but i tend to do this:
docmd.gotorecord,,acmoveprevious
docmd.gotorecord,,acMoveNext.

The syntax won't right but u get the just. Like i said, it is probably a very amatuerish way of doing things but it tends to work.

Nick
 
Thank Nick,

that was just almost like what I've done except through a recordset. Unfortunately, if there's only one record, the focus is not moving anywhere. So no update is done in the record source.

However, I just found another way that will do the save,
"subform.refresh".
Usually docmd will work too, but whatever... I'll use anything that will make it work...he...

Thanks though!




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top