Re: Display control dependant on contents of another control
- From: "Darhl Thomason" <darhlt@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sun, 13 Nov 2005 18:41:01 -0800
Allen,
Would you please explain to me why I should use the code you provided me
with (which works great) instead of doing it with an IIF statement (which
also works)? I'm just trying to learn better ways of doing things.
Thanks,
Darhl
"Darhl Thomason" <darhlt@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:OC%23Mh5L6FHA.3592@xxxxxxxxxxxxxxxxxxxxxxx
> Thanks Allen,
>
> I've gotta learn that IIF better. It seems like it's a type of if/then
> you can use on txt controls.
>
> I changed the control source of the txt box to:
> =IIf([txtProcessor]="Buypass","ID = " & Mid([Merch#],5,6),Null)
>
> Thanks again for your help!
>
> Darhl
>
>
> "Allen Browne" <AllenBrowne@xxxxxxxxxxxxxx> wrote in message
> news:ugdUUyB6FHA.3388@xxxxxxxxxxxxxxxxxxxxxxx
>> So, you want to show the txtBuypassID field on a report, only when
>> txtProcessor contains the word "Buypass".
>>
>> Simplest thing is to add a text box to the report, and set its Control
>> Source to:
>> =IIf([txtProcessor] = "Buypass", [txtBuyPassID], Null)
>>
>> If you need to hide the label associated with that text box also,
>> right-click it and choose Change To | Text Box. Then set the Control
>> Source of this text box to:
>> =IIf([txtBuyPassID] Is Null, Null, "Whatever label you want")
>>
>> It is possible to do this with the Format event of the (Detail?) Section
>> of the report, but that is way slower using the IIf() expression. It is
>> also possible to fudge it with Conditional Formatting (hiding via white
>> text on a white background), but again the simple IIf() is better.
>>
>> If you end up with #Error in your text box, and the expression is
>> correct, make sure the text box Name is not the same as the name of one
>> of the fields in the report's RecordSource.
>>
>> --
>> Allen Browne - Microsoft MVP. Perth, Western Australia.
>> Tips for Access users - http://allenbrowne.com/tips.html
>> Reply to group, rather than allenbrowne at mvps dot org.
>>
>> "Darhl Thomason" <darhlt@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:ukHY48A6FHA.3760@xxxxxxxxxxxxxxxxxxxxxxx
>>> Thanks Allen! That did the trick. Now, can this be adapted to a
>>> report?
>>>
>>> Thanks again,
>>>
>>> Darhl
>>
>>
>
>
.
- References:
- Re: Display control dependant on contents of another control
- From: Darhl Thomason
- Re: Display control dependant on contents of another control
- From: Darhl Thomason
- Re: Display control dependant on contents of another control
- From: Allen Browne
- Re: Display control dependant on contents of another control
- From: Allen Browne
- Re: Display control dependant on contents of another control
- Prev by Date: Re: Update sub-form
- Next by Date: Re: How to show data in form based on a selected combo box value?
- Previous by thread: Re: Display control dependant on contents of another control
- Next by thread: Re: Display control dependant on contents of another control
- Index(es):
Relevant Pages
|