View Single Post
  #11  
Old December 14th, 2009, 04:24 PM posted to microsoft.public.access.gettingstarted
Al Campagna[_2_]
external usenet poster
 
Posts: 1,462
Default If-Then-Else statements

Barb,
I agree with Ken Sheridan. The code we suggested is OK, so the
PaymentID may be something other than Null.
Is it Null ?
Is it "" ?
Is it 0 (zero)?

A trick I use in these situations is to set up the Format for the
PaymentID control...
#.00 ; -#.00 ; .00 ; \Null

If either a Positive or negative value = display normally (123.45
or -123.45)
If zero = display as .00
If Null = Display as "Null"
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."


"BarbS via AccessMonster.com" u36617@uwe wrote in message
news:a08e57f01b230@uwe...
Thank you John, for your reply. I'm using MS Access 2007. I believe the
PaymentID is NULL, but I tried your function just in case, that still
didn't
work. I also tried including all the labels, that didn't work either.
I'm
lost at what to do next.

John Spencer wrote:
You might need to hide the label also.

What version of Access are you using?
Are you sure the value of PaymentID is NULL?
Is it possible that it is a zero-length string?

You could use something like the following to handle Nulls, zero-length
strings, and strings that consist of multiple spaces.

Me.PaymentID.Visible = Len(Trim(Me.PaymentID & ""))0
Me.PaymentAmount.Visible = Len(Trim(Me.PaymentID & ""))0
Me.PaymentDate.Visible = Len(Trim(Me.PaymentID & ""))0

John Spencer
Access MVP 2002-2005, 2007-2009
The Hilltop Institute
University of Maryland Baltimore County

Thank you and the others for helping me try and figure this out.
Obviously I 'm just learning the code, but I've tried all suggestions to
no

[quoted text clipped - 27 lines]
End If
End Sub


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...arted/200912/1