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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|
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 |