Results 1 to 5 of 5
  1. #1
    gutenberg is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2016
    Posts
    31

    Discount box % (text boxes) dont work

    The discount box does not work properly. It is supposed show a % (SNPct) discount of the total amount (SNAmt). However, it does not do anything. Is there a way to solve this problem?




    SQL:




    Q_SnSumAmt:
    SELECT PurchaseQuoteDtl.SnAmt, PurchaseQuoteDtl.Cost AS SCost, Round([SCost]*[SnPct]) AS Expr1, PurchaseQuoteDtl.SnPct
    FROM PurchaseQuoteDtl;


  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    does the query produce a value in SnPct?
    is the text box mapped to the field?

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    It is supposed show a % (SNPct) discount of the total amount (SNAmt).
    Q_SnSumAmt:
    Code:
    SELECT PurchaseQuoteDtl.SnAmt, PurchaseQuoteDtl.Cost AS SCost, Round([SCost]*[SnPct]) AS Expr1, PurchaseQuoteDtl.SnPct
    FROM PurchaseQuoteDtl;
    Could be you are using "SCost" instead of "SnAmt"???

  4. #4
    gutenberg is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2016
    Posts
    31
    I tried substituting SnAmt for SCost however it did not change anything.

    Here are a list of "update queries" and the SQL associated with them:

    Q_SnSumAmt:
    SELECT PurchaseQuoteDtl.SnAmt, PurchaseQuoteDtl.Cost AS SCost, Round([SCost]*[SnPct]) AS Expr1, PurchaseQuoteDtl.SnPct
    FROM PurchaseQuoteDtl;

    Q_UnpdateSNPctToDtl
    :

    UPDATE T_OrderHeader LEFT JOIN PurchaseQuoteDtl ON T_OrderHeader.OrderNu = PurchaseQuoteDtl.OrderNu SET PurchaseQuoteDtl.SnPct = [T_OrderHeader]![SNPct];

    Q_UpdateSNAmtandDiscCost:

    UPDATE PurchaseQuoteDtl SET PurchaseQuoteDtl.SnAmt = CCur([Cost]*([SnPct]/100)), PurchaseQuoteDtl.DiscCost = CCur([Cost]-([cost]*([SnPct]/100)))
    WHERE (((PurchaseQuoteDtl.Pkg) Is Null));

    Q_UpdateSNAmtAndDiscCostAt0

    UPDATE PurchaseQuoteDtl SET PurchaseQuoteDtl.SnAmt = 0, PurchaseQuoteDtl.DiscCost = CCur([Cost])
    WHERE (((PurchaseQuoteDtl.SnPct)=0));

    Q_UpdateSNAmtAndDiscCostForEA

    UPDATE T_OrderHeader LEFT JOIN PurchaseQuoteDtl ON T_OrderHeader.QuoteID = PurchaseQuoteDtl.SQId SET PurchaseQuoteDtl.SnAmt = 0, PurchaseQuoteDtl.DiscCost = [Cost], T_OrderHeader.SN = 0, T_OrderHeader.SNPct = 0, T_OrderHeader.SNAmt = 0
    WHERE (((T_OrderHeader.IsEA)=-1));

    Q_UpdateSNAmtAndDiscCostforFreeV2


    UPDATE PurchaseQuoteDtl SET PurchaseQuoteDtl.SnAmt = 0, PurchaseQuoteDtl.DiscCost = 0
    WHERE (((PurchaseQuoteDtl.V2)=1));

    Q_UpdateSNAmtAndDiscCostForTA

    UPDATE T_OrderHeader LEFT JOIN PurchaseQuoteDtl ON T_OrderHeader.QuoteID = PurchaseQuoteDtl.SQId SET T_OrderHeader.SN = 0, T_OrderHeader.SNPct = 0, T_OrderHeader.SNAmt = 0, PurchaseQuoteDtl.SnPct = 0, PurchaseQuoteDtl.SnAmt = 0, PurchaseQuoteDtl.UnitCost = [Cost], PurchaseQuoteDtl.DiscCost = [Cost]
    WHERE (((PurchaseQuoteDtl.Pkg) Is Not Null));

    Q_UpdateSNDiscCostToCatTotal
    UPDATE PurchaseQuoteDtl SET PurchaseQuoteDtl.BookCost = IIf([PrintOrder]=1,[DiscCost],0), PurchaseQuoteDtl.NonBookCost = IIf([PrintOrder] In (0,2,3,4,5,6,7,8),[DiscCost],0), PurchaseQuoteDtl.RevewCost = IIf([PrintOrder]=9,[DiscCost],0), PurchaseQuoteDtl.NonBookFinCost = IIf([PrintOrder] In (2,3,4,5,6,7,8),[DiscCost],0), PurchaseQuoteDtl.NewCost = [DiscCost];

    Q_UpdateSnInOrderHeader

    UPDATE T_OrderHeader LEFT JOIN T_Finance ON T_OrderHeader.SNPct = T_Finance.InvTime SET T_OrderHeader.SNAmt = [NonBookRevTotal]*([SNPct]/100);

    Q_UpdateSnPctToDtl

    UPDATE T_OrderHeader LEFT JOIN PurchaseQuoteDtl ON T_OrderHeader.OrderNu = PurchaseQuoteDtl.OrderNu SET PurchaseQuoteDtl.SnPct = [T_OrderHeader]![SNPct];

    Q_UpdateSnPctToDtl_2

    UPDATE (T_Finance INNER JOIN T_OrderHeader ON T_Finance.InvTime = T_OrderHeader.SNPct) LEFT JOIN PurchaseQuoteDtl ON T_OrderHeader.OrderNu = PurchaseQuoteDtl.OrderNu SET PurchaseQuoteDtl.SnPct = [T_Finance]![FinanceFee];

    Q_UpdateZeroSN

    UPDATE T_OrderHeader SET T_OrderHeader.SNPct = 0
    WHERE (((T_OrderHeader.SN)=0));

  5. #5
    gutenberg is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2016
    Posts
    31
    does the query produce a value in SnPct? No. Your supposed to type in a value there.

    is the text box mapped to the field? Yes

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Requery macro dont work
    By Lubosh97 in forum Macros
    Replies: 2
    Last Post: 05-06-2014, 08:21 AM
  2. vba code dont work
    By mikichi in forum Programming
    Replies: 7
    Last Post: 11-12-2013, 01:59 PM
  3. UNION qry dont work as expected.
    By rncarterjm in forum Queries
    Replies: 10
    Last Post: 04-02-2013, 07:53 AM
  4. macros in subform dont work
    By tuyo in forum Access
    Replies: 2
    Last Post: 03-25-2011, 09:49 AM
  5. Criteria from Combobox dont work.
    By Ryan in forum Queries
    Replies: 3
    Last Post: 08-31-2009, 07:09 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums