A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

If-Then-Else statements



 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #11  
Old December 14th, 2009, 03: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



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:41 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.