UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

> Set 0 Values to Null    
 
   
mvarner2000
post Dec 20 2004, 03:15 PM
Post #1

UtterAccess Enthusiast
Posts: 72
From: Gastonia, NC



I have an access report with currency values. In the records that are $0.00 I would like the fields to be blank. How can I do this?
Go to the top of the page
 
+
 
Start new topic
Replies (1 - 7)
khaos
post Dec 20 2004, 03:17 PM
Post #2

Retired Moderator
Posts: 8,589
From: Lansing, MI



You can display them as blanks using the following

=IIf([FieldName]=0,"",[Fieldname])

You could aslo do it via vba code and hide this control using the visible property.

HTH
Ken
Go to the top of the page
 
+
mvarner2000
post Dec 20 2004, 03:31 PM
Post #3

UtterAccess Enthusiast
Posts: 72
From: Gastonia, NC



Can you show me how I would do this with VBA?
Go to the top of the page
 
+
Jerry Dennison
post Dec 20 2004, 04:04 PM
Post #4

Head Wizard
Posts: 14,857
From: South Carolina, USA



Thy this:

...
If Not [FieldName] Then
Me.ControlName = Null
Else Me.ControlName = [FieldName]
End If
...


NOTE: The control should not be the same name as the field nor should it be bound to the field.
Go to the top of the page
 
+
mvarner2000
post Dec 20 2004, 11:04 PM
Post #5

UtterAccess Enthusiast
Posts: 72
From: Gastonia, NC



I had to use the first option and I put the code in the query for the report. The values are correct but I cannot format it. I can't select currency and when I type it in, it doesn't do anyting.

Here is the code from the query, H1reva: IIf(tblrevcomp.h1rev=0,"",tblrevcomp.h1rev).

Do I need to use some format command and if so, where do I put it?

Thanks

Marshall
Go to the top of the page
 
+
muamshai
post Dec 21 2004, 03:33 AM
Post #6

UtterAccess Addict
Posts: 193
From: Helsinki, Finland



Ok, here is the solution.

When there is Null value in table then I need to print --- in place of it.

For this, in design window of the report.
select the text box
go in the properties of it
in format, write like 0,00;;;-- (in your case, it will be 0,00;;; )
Go to the top of the page
 
+
mvarner2000
post Dec 21 2004, 03:29 PM
Post #7

UtterAccess Enthusiast
Posts: 72
From: Gastonia, NC



Thanks for the help.

My format command looked a litte different after I entered it,

#,##0.00;;""

The #,s appeared after I entered the text you recommended and the like wouldn't work.

Thanks again for the help. It all works properly now.

Marshall
Go to the top of the page
 
+
muamshai
post Dec 22 2004, 01:51 AM
Post #8

UtterAccess Addict
Posts: 193
From: Helsinki, Finland



glad to know that the small hint gave you an idea (IMG:http://www.utteraccess.com/forum/style_emoticons/default/frown.gif)
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 19th June 2013 - 08:34 PM