Results 1 to 15 of 15
  1. #1
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    IIf help (2002 SP-2)

    I've been away from the board too long.

    In a report, I want to display the telephone number (txtPhone) only for those who have selected (blnPhone) to reveal it to others.
    =IIf([blnPhone]=No,[txtPhone],"Private")
    . . .is returning #Error
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: IIf help (2002 SP-2)

    Hi Bryan,

    Use False instead of No.

  3. #3
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: IIf help (2002 SP-2)

    Well, Hellllloooooo Prof.! Long time no "see"!
    What are you doing around this time of day/night/morning? (8:00PM here)
    I tried "False" but got the same #Error
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: IIf help (2002 SP-2)

    You didn't happen to name this text box txtPhone, did you? That would confuse Access - you can't use a name that is also used in an expression in the control source.

  5. #5
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: IIf help (2002 SP-2)

    Hold the phone good friend. . .
    I (apparently) was trying to "edit" the original txtPhone control source and it wasn't taking. I deleted the txtPhone box, added a new one and it works just fine now. I haven't been around for quite a long time (you pretty much "perfected" my db for me) and I've been pretty busy. Sure miss you guys though. So, how have you survived without me around to ask inane questions?
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: IIf help (2002 SP-2)

    Barely <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

  7. #7
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: IIf help (2002 SP-2)

    <img src=/S/rofl.gif border=0 alt=rofl width=15 height=15>
    Like I said, I really miss you guys! <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    Thanks, as always, for the assist!
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  8. #8
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: IIf help (2002 SP-2)

    Wooops!
    That works really well until I get to the e-mail address (in the table as a Hyperlink)
    =IIf([blnEmail]=No,[txtEmail],"Private")
    displays: someone@somewhere.com#http://someone@. . .
    Is that because I have it as a Hyperlink in the table? Can it be corrected in the report, or am I stuck changing the table entry?
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: IIf help (2002 SP-2)

    That's because it is a hyperlink field indeed. You can extract the e-mail address, but it ain't pretty:

    =IIf([blnEmail]=False,Mid([txtEmail],InStr([txtemail],"#")+1,InStr(InStr([txtemail],"#")+1,[txtEmail],"#")-InStr([txtEmail],"#")-1),"Private")

  10. #10
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: IIf help (2002 SP-2)

    You're really missing me now huh? <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    Close, but still got http://
    http://someone@somewhere.com
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  11. #11
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: IIf help (2002 SP-2)

    This then?

    =IIf([blnEmail] = False, Mid([txtEmail], InStr([txtEmail], "#") + 8, InStr(InStr([txtEmail], "#") + 8, [txtEmail], "#") - InStr([txtEmail], "#") - 9), "Private")

  12. #12
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: IIf help (2002 SP-2)

    <img src=/S/rofl.gif border=0 alt=rofl width=15 height=15>
    someone@somewhere.co
    someone@somewhere.ne

    . . .and where's the This Then statement go? <img src=/S/grin.gif border=0 alt=grin width=15 height=15>
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  13. #13
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 28 Times in 28 Posts

    Re: IIf help (2002 SP-2)

    Change the -9 to -8.

  14. #14
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: IIf help (2002 SP-2)

    =IIf([blnEmail]=False,Mid([txtEmail],InStr([txtEmail],"#")+8,InStr(InStr([txtEmail],"#")+8,[txtEmail],"#")-InStr([txtEmail],"#")-8),"Private")
    This works. . .but I still don't get where This Then goes.
    Also, I noticed you waited for me to figure it out. . .ever the teacher - I love it!
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

  15. #15
    5 Star Lounger bfxtrfcmgr's Avatar
    Join Date
    Aug 2002
    Location
    Fresno, California, USA
    Posts
    995
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Re: IIf help (2002 SP-2)

    Ooops. . .I "stepped" on your reply.
    Anyway, thanks for the help Hans. As always, it's been fun (for me anyway) <img src=/S/grin.gif border=0 alt=grin width=15 height=15>.
    Bryan,
    Not the smartest critter on the glacier. . .
    . . .but I'm persistent (does that count?)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •