Results 1 to 5 of 5
  1. #1
    uoghk is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jan 2022
    Posts
    149

    Print nothing when zero

    in my invoice report, i use textbox to print the invoice amount (with 2 decimal places).


    how to print nothing if invoice amount is 0 ?
    in addition, how to print invoice amount with 2 decimal for normal clients, but only 1 decimal for some specific clients?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Can use conditional IIf() expression in textbox.

    Why would an invoice amount be 0?

    How would you identify those "spcecific" clients?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    uoghk is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jan 2022
    Posts
    149
    invoice amount is 0 because it is free of charge.

    Clients may be ClientType either "VIP" or "NORMAL"
    then how to print 1 decimal point for VIP, 2 decimal points for NORMAL ?

  4. #4
    Gicu's Avatar
    Gicu is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,115
    In the Format or Print event of the report section containing the textbox for the invoice amount add something like this:
    Code:
    If Me.ClientType="VIP" Then
       Me.InvoiceAmount=Format (Me.InvoiceAmount, "#,#0.0")
    Else
    'Normal
       Me.InvoiceAmount=Format (Me.InvoiceAmount, "#,##0.00")
    End If
    'change font color to white if amount =0
    If Me.InvoiceAmount=0 Then Me.InvoiceAmount.ForeColor=RGB(255, 255, 255)
    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  5. #5
    uoghk is offline Competent Performer
    Windows 10 Office 365
    Join Date
    Jan 2022
    Posts
    149
    Thanks Gicu & June7

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

Similar Threads

  1. Replies: 5
    Last Post: 09-16-2019, 01:12 AM
  2. Replies: 1
    Last Post: 07-24-2019, 07:49 AM
  3. Replies: 5
    Last Post: 07-29-2014, 01:05 PM
  4. Replies: 6
    Last Post: 03-01-2014, 07:07 AM
  5. Replies: 5
    Last Post: 10-26-2011, 02:59 PM

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