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 » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Text box question



 
 
Thread Tools Display Modes
  #1  
Old December 6th, 2005, 10:48 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default Text box question

I have the following code:

=[Quantity_Min] & " - " & [Quantity_Max]

It displays fine, but when the second is null, it still displays the first
and the dash. I want it to display the Min - Max if both are not null, or
display Min if the second is null. The first will never be null.
  #2  
Old December 6th, 2005, 11:27 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default Text box question

Hey Matt,

One thought on doing this could be:

If Trim(Nz([Quantity_Max],"")) = "" Then
=[Quantity_Min]
Else
=[Quantity_Min] & " - " & [Quantity_Max]
End If

HTH,
Shane


Matt Muzila wrote:
I have the following code:

=[Quantity_Min] & " - " & [Quantity_Max]

It displays fine, but when the second is null, it still displays the first
and the dash. I want it to display the Min - Max if both are not null, or
display Min if the second is null. The first will never be null.


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200512/1
  #3  
Old December 7th, 2005, 01:57 AM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default Text box question

Can this be pasted into the control source of the text box or does it have to
be implemented someway else?
  #4  
Old December 7th, 2005, 03:10 AM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default Text box question

Hey Matt,

You could probably do an IIF in the control source but honestly, I have done
very few of them so I'm not too dependable on helping you with one, but
outside of that, yes it would need to be implemented some where else.
Depends on what these fields are and what they are doing and the timing that
they are doing them in.

Shane

Matt Muzila wrote:
Can this be pasted into the control source of the text box or does it have to
be implemented someway else?


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200512/1
  #5  
Old December 7th, 2005, 05:17 AM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default Text box question

Try:

= [Quantity_Min] & IIf(IsNull([Quantity_Max]), "", " - " & [Quantity_Max])

--
HTH
Van T. Dinh
MVP (Access)



"Matt Muzila" wrote in message
...
I have the following code:

=[Quantity_Min] & " - " & [Quantity_Max]

It displays fine, but when the second is null, it still displays the first
and the dash. I want it to display the Min - Max if both are not null, or
display Min if the second is null. The first will never be null.



  #6  
Old December 7th, 2005, 01:03 PM posted to microsoft.public.access.forms
external usenet poster
 
Posts: n/a
Default Text box question

Hey Mr. Dinh,

Thanks for stepping in and lending a helping hand. IIF is not my strong suit.


Shane

Van T. Dinh wrote:
Try:

= [Quantity_Min] & IIf(IsNull([Quantity_Max]), "", " - " & [Quantity_Max])

I have the following code:

[quoted text clipped - 3 lines]
and the dash. I want it to display the Min - Max if both are not null, or
display Min if the second is null. The first will never be null.


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...forms/200512/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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is Access even the right idea? BMB New Users 19 November 21st, 2005 08:01 PM
Creating dynamic cross reference links in a Word document torajudo General Discussion 4 October 25th, 2005 03:51 PM
Add New Field to DB Karen Database Design 7 October 19th, 2005 08:03 PM
Ideas On Producing Envelopes & Labels For Data RNUSZ@OKDPS Setting Up & Running Reports 0 April 28th, 2005 03:22 PM
Outline Renee Hendershott Page Layout 2 December 25th, 2004 02:49 PM


All times are GMT +1. The time now is 08:30 AM.


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