开发者

Subform not updating from other subform input in Access 2010

开发者 https://www.devze.com 2023-04-04 16:37 出处:网络
I h开发者_JAVA百科ave a database with 2 sub forms within a form with fields as below Sub Form 1: \'Qty Booked In\', \'Qty Booked Out\'

I h开发者_JAVA百科ave a database with 2 sub forms within a form with fields as below

Sub Form 1: 'Qty Booked In', 'Qty Booked Out' Sub Form 2: 'Total Stock'

When running in Access 2003, the 'Total stock' field is updated when a 'Refresh' button is clicked depending on the values entered into the 'Booked in' or 'Booked out' fields. This is done using the following code and works fine:

DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70

When I open this database in Access 2010, the 'Total Stock' field will not update. I have tried amending the code to the below, with no success.

DoCmd.RunCommand.acCmdRefresh

I have also tried the following code with no success either:

DoCmd.RunCommand acCmdSaveRecord

I'm not an Access expert by any means but was just wondering if there is something obvious that I have missed?

Thanks


I have managed to solve this myself:

Me.TblQty.SetFocus
DoCmd.RunCommand acCmdSaveRecord
DoCmd.GoToRecord , , acNewRec
Me.TblQty_Query.SetFocus
Me.TblQty_Query.Requery


Try

Me.Recalc

DoMenuItem is long since deprecated.

0

精彩评论

暂无评论...
验证码 换一张
取 消