Results 1 to 5 of 5
  1. #1
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2002
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383

    Else If statement needed.If value is zero then show $0.00

    I refer to my subform to get the total of payments made and then subtract this amount from the Order Total (main form). Problem is, what if NO payments have been made? Then the Order Total shows nothing.


    =TPaymentSub.Form!SumPayment This is the control source for the textbox that shows the sum of payments made. It uses the subform/SumPayment as it's control source.textbox is located on the main form. textbox is named txt102 subform SumPayment is named SumPayment. It is unbound but uses as it's control source =Sum([Payment]) Also it's default value is set to =Nz([SumPayment],0)

    My Order Total shows nothing if SumPayment is zero., txtOrderTotal is the name of the control and control source is =Nz([txtOrderSubtotal])+Nz([FreightCharge])+Nz([Taxes])-[txt102]

    subform shows nothing as well if no payments have been made?

    How can I make the subform show a 0.00 value if NO payments have been made?


    I have tried using this code on the OnCurrent and BeforeUpdate Events with NO success;
    If IsNull(SumPayment) Then ' Set Value To Zero if has no value
    [SumPayment] = "0"
    End If

    I even add a textbox to my main form and set value to zero,i.e. $0.00 and have the Order Total add it back and no success either?? Sheeesh !
    Attached Thumbnails Attached Thumbnails NoAmount.jpg  
    Last edited by burrina; 11-19-2012 at 12:30 PM. Reason: Tried This,No Worky

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2002
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    That didn't work, unless I did not do it right.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    I have no idea what "didn't work" means, and not knowing exactly what you did, no way of knowing what you may have done wrong.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2002
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    Thanks, I was just fixing to post back. Sorry for the bad post. I did resolve the situation by simply adding another field and using it as a Grand Total, removing the subtract SumPayment from the txtOrderTotal . So now the Order Total shows the Order Total and NOT the Applied Payments. However, the Grand Total reflects the Order Total Minus the sum of all payments. Grand Total equals; =[txtOrderTotal]-[txt102] (Order Total Minus Payments)

    "Sometimes the solution is not to fix the problem, but instead use a different approach"

    You heard it here first,

    Many Thanks.

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

Similar Threads

  1. If Statement Criteria Needed for form
    By burrina in forum Forms
    Replies: 6
    Last Post: 11-16-2012, 11:00 PM
  2. if statement in sql statement, query builder
    By 54.69.6d.20 in forum Access
    Replies: 4
    Last Post: 09-11-2012, 07:38 AM
  3. Replies: 11
    Last Post: 03-21-2012, 12:51 PM
  4. Replies: 7
    Last Post: 08-17-2011, 01:49 PM
  5. Help needed with "and=" statement
    By newtoAccess in forum Queries
    Replies: 4
    Last Post: 12-06-2010, 04:10 PM

Tags for this Thread

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