[mso] Access 2002: Calculating On Sub Form

  • From: Cathy.Evans@xxxxxxxxx
  • To: mso@xxxxxxxxxxxxx
  • Date: Tue, 22 Jun 2004 10:15:39 -0400

Have a subform where user enters line items, quantity and unit price, this
detail is tied to a purchase order.  Need to get a 'refreshed total' on my
main purchase order form if user adds/changes quantity or unit price in
subform.  I had the form at one time tied to a table, then had a 'refresh'
button on the main form with the following row source:

SELECT DISTINCT Sum(([UnitPrice]*[QTY])) AS TotalPrice FROM SitePODetail
WHERE (((SitePODetail.PackageNumber) Like [forms]![SitePO]![FullNumber]));

And the following code on GotFocus of 'refresh' button:

Private Sub Commit_GotFocus()
    DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70

End Sub

This refresh code worked if the user double clicked the 'refresh' button.
Now I have changed the form, it is no longer tied to a data source, I now
have it tied to a couple of combo boxes that bring in specific data to
unbound text boxes, depending on combo box choice.  This change caused my
'refresh' button to stop working, and am getting an error telling me
refresh command isn't available now.  If I change quantities/pricing and go
to design view, then back to form view, it refreshes, but how can I
accomplish this for users so they can see the changes as they edit?  Tried
to put a 'total' on the subform, but no luck there, either.  Appreciate any
advice, I may be looking at this whole thing wrong.  Thank you, Cathy




-----------------------------------------------------------------------------------------------------
The information transmitted is intended only for the person
or entity to which it is addressed and may contain confidential
and/or privileged material. If you are not the intended recipient 
of this message you are hereby notified that any use, review,
retransmission, dissemination, distribution, reproduction or any
action taken in reliance upon this message is prohibited. If you 
received this in error, please contact the sender and delete the 
material from any computer.  Any views expressed in this message
are those of the individual sender and may not necessarily reflect 
the views of the company.  
-------------------------------------------------------------------------------------------------------

*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or 
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, send an email to 
mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the quotes) in 
the subject line.

Or, visit the group's homepage and use the dropdown menu.  This will also allow 
you to change your email settings to digest or vacation (no mail).
//www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group, send a 
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with 
instructions.  Once you are a member of the files group, you can go here to 
upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************

Other related posts:

  • » [mso] Access 2002: Calculating On Sub Form