WUGNET, the Windows User Group Network
Your Complete Resource Center for "The Best" in Shareware, Computing Tips and Support, Windows Industry News... and much more!
Home Forums Shareware Windows Tips Hot Offers FREE Newsletters Arcade Contact Us About Partners
Search WUGNET: RSS Feeds RSS Feeds Advertise with WUGNET    |    Shareware eBooks
HomeHome FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log in/Register/PasswordLog in/Register/Password

getting many Yes/No controls to shrink

 
   Home -> Office other -> Reports RSS
Next:  Reports: Keep a group of objects together on the same page  
Author Message
JIM

External


Since: Mar 15, 2006
Posts: 11



(Msg. 1) Posted: Thu Jul 24, 2008 7:26 pm
Post subject: getting many Yes/No controls to shrink Add to elertz
Archived from groups: microsoft>public>access>reports (more info?)

Using A2000 I'm trying to assign a value to an unbound textbox in order to
use the can shrink property but I get an #Error when I use this method:

=IIf([TwoInv]=False And [L&M]=False And [PO]=False And [SHNotes]=False,"Spec
Hand: 2Inv " & [TwoInv] & " LM " & [L&M] & " PO " & [PO],Null)

TwoInv, L&M, and PO are yes/no fields; SHNotes is a memo field. The plan
was to make the whole line Null unless there was something in any of the
fields. Thinking about it I realize I can't print out a yes/no field but I
don't know how to approach.
Thanks
Back to top
Login to vote
Marshall Barton

External


Since: Dec 07, 2003
Posts: 5903



(Msg. 2) Posted: Thu Jul 24, 2008 11:27 pm
Post subject: Re: getting many Yes/No controls to shrink Add to elertz [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

JIM wrote:

>Using A2000 I'm trying to assign a value to an unbound textbox in order to
>use the can shrink property but I get an #Error when I use this method:
>
>=IIf([TwoInv]=False And [L&M]=False And [PO]=False And [SHNotes]=False,"Spec
>Hand: 2Inv " & [TwoInv] & " LM " & [L&M] & " PO " & [PO],Null)
>
>TwoInv, L&M, and PO are yes/no fields; SHNotes is a memo field. The plan
>was to make the whole line Null unless there was something in any of the
>fields. Thinking about it I realize I can't print out a yes/no field but I
>don't know how to approach.


A memo field will never be False so that check needs to ne
changed. You also have the last two arguments of the IIf
function backwards so you only display the case where they
are all false.

I think(?) you want something more like:

=IIf([TwoInv]=False And [L&M]=False And [PO]=False And
Len([SHNotes])=0, Null,"Spec Hand: 2Inv " & [TwoInv] & "
LM " & [L&M] & " PO " & [PO])

Another reason for #Error is if the text box is named the
same as any of the fields in the expression.

--
Marsh
MVP [MS Access]
Back to top
Login to vote
JIM

External


Since: Mar 15, 2006
Posts: 11



(Msg. 3) Posted: Mon Jul 28, 2008 10:45 am
Post subject: Re: getting many Yes/No controls to shrink Add to elertz [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thank you Marshall, yes I did have my logic wrong in IIf statement. The
other was just a careless mistake, I meant [SHNotes] = Null.
For those interested this is how problem was resolved: The source for my
report was a select query joining two files and there wasn't always a special
handling record for every account so that the yes/no fields in that case were
null. So I updated the 3 yes/no fields in SQL view in query to be:
Val(Nz[TwoInv],0) As UpdTwoInv (to force a numeric 0)

Then the report line label is printed by a unbound text box only if all
fields and not false or null:
=IIf([UpdTwoInv]=False And [UpdLM]=False And [UpdPO]=False And [SHNotes] Is
Null,Null,"Spec Hand:")
and each individual field is only printed if true:
=IIf([UpdTwoInv]=True,"2 Inv X ",Null
and the report section and each text box are assigned as can shrink - yes.
It works perfect now and if there are no special handling requirements the
line disappears from that account page.
Thanks again Marshall for putting me on the right track with the logic. It
made me look at my data.
JIM



"Marshall Barton" wrote:

> JIM wrote:
>
> >Using A2000 I'm trying to assign a value to an unbound textbox in order to
> >use the can shrink property but I get an #Error when I use this method:
> >
> >=IIf([TwoInv]=False And [L&M]=False And [PO]=False And [SHNotes]=False,"Spec
> >Hand: 2Inv " & [TwoInv] & " LM " & [L&M] & " PO " & [PO],Null)
> >
> >TwoInv, L&M, and PO are yes/no fields; SHNotes is a memo field. The plan
> >was to make the whole line Null unless there was something in any of the
> >fields. Thinking about it I realize I can't print out a yes/no field but I
> >don't know how to approach.
>
>
> A memo field will never be False so that check needs to ne
> changed. You also have the last two arguments of the IIf
> function backwards so you only display the case where they
> are all false.
>
> I think(?) you want something more like:
>
> =IIf([TwoInv]=False And [L&M]=False And [PO]=False And
> Len([SHNotes])=0, Null,"Spec Hand: 2Inv " & [TwoInv] & "
> LM " & [L&M] & " PO " & [PO])
>
> Another reason for #Error is if the text box is named the
> same as any of the fields in the expression.
>
> --
> Marsh
> MVP [MS Access]
>
Back to top
Login to vote
Display posts from previous:   
       Home -> Office other -> Reports All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Categories:
 Windows XP
 Windows Vista
 Windows Other
 Office
  Office Other
 Security
 WinRAR
  • Home |
  • Shareware |
  • Windows Tips |
  • Hot Offers |
  • FREE Newsletters |
  • Arcade |
  • Forums |
  • eBooks |
  • About WUGNET |
  • Partners |
  • Contact

  • WUGNET Privacy Policy |
  • Link to WUGNET