PC Review


Reply
Thread Tools Rate Thread

Adding data to Subform and save and running a total price calc

 
 
Simon
Guest
Posts: n/a
 
      4th Jul 2010
I have a database for placing customer order, i have a frmOrder and
then two subforms, one which shows items in order and then subform
with a list of products we sell, on the subform of products we sell i
have a button that adds that product, price ect to the subform of
procucts the customer has orderd.
As i add the product i want frmOrder.Total to update but can not
getting this to work
I think i have a problem when when the item is added its not saving or
somthing


DoCmd.Save

'go to new record

Forms![frmOrder]![OrderProductsForm].SetFocus
DoCmd.RunCommand acCmdSelectRecord
DoCmd.GoToRecord , , acNewRec


Forms![frmOrder]![OrderProductsForm].Form![OrderNumber] = Forms!
[frmOrder]![OrderNumber]
Forms![frmOrder]![OrderProductsForm].Form![IDNumber] =
CLng(Nz(DMax("IDNumber", "tblOrderProduct"), 0)) + 1
Forms![frmOrder]![OrderProductsForm].Form![ProductName] =
Me.ProductName
Forms![frmOrder]![OrderProductsForm].Form![ProductCode] =
Me.ProductCode
Forms![frmOrder]![OrderProductsForm].Form![ProductID] = Me.ProductID
Forms![frmOrder]![OrderProductsForm].Form![Discount] = 0
Forms![frmOrder]![OrderProductsForm].Form![UnitPriceExVAT] =
Me.txtPrice
Forms![frmOrder]![OrderProductsForm].Form![UnitPriceIncVAT] =
FormatNumber(Forms![frmOrder]![OrderProductsForm].Form!
[UnitPriceExVAT] * stVAT, 2)
Forms![frmOrder]![OrderProductsForm].Form![TotalIncVAT] =
FormatNumber(Forms![frmOrder]![OrderProductsForm].Form!
[UnitPriceExVAT] * stVAT, 2)
Forms![frmOrder]![OrderProductsForm].Form![TotalExVAT] = Me.txtPrice
Forms![frmOrder]![OrderProductsForm].Form![Quantity] = 1
DoCmd.Save
Me.Requery
DoCmd.Save



Forms![frmOrder]!Total = DSum("[TotalIncVAT]", "tblOrderProduct",
"[OrderNumber] = Forms![frmOrder]!OrderNumber.Value")
Forms![frmOrder]!SubTotal = DSum("[TotalExVAT]", "tblOrderProduct",
"[OrderNumber] = Forms![frmOrder]!OrderNumber.Value")
Forms![frmOrder]!VAT = Forms.frmOrder.Total - Forms.frmOrder.SubTotal
Forms![frmOrder]![Outstanding] = Forms![frmOrder]![Total] -
(DLookup("Amount", "qryPaymentsTotals", "OrderNumber = " & Forms!
[frmOrder]!OrderNumber.Value))



Any on e got ideas on how to make saves to Forms![frmOrder]!
[OrderProductsForm].
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pivot Table Grand Total Plus Calc Field or GT Running Balance Mathew P Bennett Microsoft Excel Misc 6 18th Aug 2008 10:35 PM
Pivottable calc. avg. field based upon monthly running price =?Utf-8?B?cHJlYmFuZw==?= Microsoft Excel Misc 0 18th Sep 2007 01:08 PM
Can you use two running total data items to calc a third data item =?Utf-8?B?SERM?= Microsoft Excel Misc 1 2nd Feb 2007 04:13 AM
How to automatically save the running total in subform in the pare =?Utf-8?B?QnJldHN3?= Microsoft Access Form Coding 6 27th Feb 2006 04:04 PM
query to calc running total =?Utf-8?B?am1k?= Microsoft Access Queries 1 23rd Oct 2004 11:09 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:51 AM.