Stuart McLachlan
stuart at lexacorp.com.pg
Thu Oct 30 17:55:46 CDT 2008
Total CharQty will be updated as soon as the record is saved. If you want it updated when you enter a value in CharQty, you will have to put an explicit "Docmd acCmdSaveRecord" in CharQty's After_Update event procedure. Is your subform a true subform (ie embedded in your form) or is it actually a completely different form which you open and then close? One way to transfer the information would be to put the following in the On_CLose event of your "subform'. Forms!frmPAInput.Form.Observations = TotalCharQty -- Stuart On 30 Oct 2008 at 10:55, Eget, John wrote: > Thank you for the response. > > I already have set the value of TotalCharQty to > "=Sum(CharQty)". But > I must either enter a new record or click on a refresh command button to > update. I was looking for the ability to update the TotalCharQty after > the value of CharQty is entered or updated. > > Unfortunately the subform is closed after data entry so the transfer of > information to the main form must occur when either the subform closes > out or while the subform is still open. > > > ----- Original Message ----- > From: "Stuart McLachlan" <stuart at lexacorp.com.pg> > To: "Access Developers discussion and problem solving" > <accessd at databaseadvisors.com> > Sent: Thursday, October 30, 2008 12:11 AM > Subject: Re: [AccessD] Transfer info from subform to parent form > > > > You don't need the Refresh button. Set the value of TotalCharQty to > > "=Sum(CharQty)". That way, the total will keep itself updated. > > > > If you want to have Observations automatically filled in, but also > want to > > ability to enter it > > manually, > > one way is to fill in the value when you enter the field, you can then > > > accept the entry or enter > > something else. > > To do this, use an On Enter event procedure like this: > > > > Private Sub Observations_Enter() > > If IsNull(Observations) or Observations = "" Then 'only update if it's > > > empty > > Observations = subfrmCharPA.Form.TotalCharQty > > End if > > End Sub > > > > > > > > On 29 Oct 2008 at 23:49, John Eget wrote: > > > >> Hi > >> > >> On the form named frmPAInput, I click on a command button to open a > >> subform named subfrmCharPA > >> > >> After entering several records that contain values on the subform > >> named subfrmCharPA, I display a total value by depressing a command > >> button labeled Refresh Total. That enables the values of CharQty > that > >> have been entered on the subform to be totalled and displayed in a > >> text box named TotalCharQty on the subform > >> > >> I then can manually enter that value on the form frmPAInput, in a > field > >> named Observations. > >> > >> Is it possible to have the value be automatically entered from the > >> subform to the main form? And also if there were no subform entries, > >> would I still be able to enter an observation value manually? > >> > >> I have tried the wizard to generate the code but have been unable to > get > >> this correct. > >> > >> Thanks > >> > >> John > >> -- > >> AccessD mailing list > >> AccessD at databaseadvisors.com > >> http://databaseadvisors.com/mailman/listinfo/accessd > >> Website: http://www.databaseadvisors.com > > > > > > -- > > AccessD mailing list > > AccessD at databaseadvisors.com > > http://databaseadvisors.com/mailman/listinfo/accessd > > Website: http://www.databaseadvisors.com > > > > >