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

    If Value < or > Caption Equals Invoice or Credit Invoice

    My issues is this; If my Invoice amount is greater than 0 then I want to set the label to Invoice, if not Credit Invoice



    Problem is that if there is a negative amount, i.e. a Credit Invoice due, then code does not work, only shows Invoice.

    Right now it shows Invoice and that;s it, even though one record is a Invoice and the next a Credit Invoice.

    What am I doing wrong?

    If Me.GrandTotal < 0 Then
    Label1000.Caption = "Credit Invoice"
    ElseIf Me.GrandTotal > 0 Then
    Label1000.Caption = "Invoice"
    End If

  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,521
    In a form, you'd need to have a textbox with this type of thing:

    =IIf(GrandTotal < 0, "Credit Invoice", "Invoice")

    Code like that could work on a report, but won't work on a continuous or datasheet form. It could work in a single view form, with the code in the current event.
    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
    Cool, that worked. Man, I wish had learned this when I was young and mt brain actually worked.

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

    Thanks,

  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,521
    Happy to help.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 1
    Last Post: 10-10-2012, 01:05 PM
  2. Invoice
    By heavenbound4life in forum Access
    Replies: 1
    Last Post: 10-05-2012, 01:10 PM
  3. Invoice and subforms
    By potatoheadsir in forum Forms
    Replies: 1
    Last Post: 04-25-2012, 01:51 PM
  4. Invoice number
    By slik_02 in forum Access
    Replies: 3
    Last Post: 08-08-2009, 08:05 AM
  5. Invoice
    By billyff in forum Access
    Replies: 3
    Last Post: 04-25-2009, 12:15 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