Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 9th, 2004, 10:55 AM
Registered User
 
Join Date: Jul 2004
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default IIF Statement

I have a text box on a report called Procedure that has a record source of Procedure.

I am trying to make the record source be:

=iif([Category]="Glasses",[Procedure],"0")

when the expression runs, it gives me the source of Procedure no matter if it's true or false. [Category] is a listbox with different values in there.

Another question is, instead of displaying the "0", what I really want is to skip the line and go to next. Any idea how to do that?

Thank you.

Regards

Loke
 
Old July 9th, 2004, 11:59 PM
Friend of Wrox
Points: 1,288, Level: 14
Points: 1,288, Level: 14 Points: 1,288, Level: 14 Points: 1,288, Level: 14
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2004
Location: Stockholm, Sweden
Posts: 331
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to qazi_nomi
Default

Similar post at
http://p2p.wrox.com/topic.asp?TOPIC_ID=15874

Love 4 all
 
Old July 12th, 2004, 08:27 AM
Friend of Wrox
Points: 4,007, Level: 26
Points: 4,007, Level: 26 Points: 4,007, Level: 26 Points: 4,007, Level: 26
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Lansing, Michigan, USA.
Posts: 1,151
Thanks: 2
Thanked 14 Times in 14 Posts
Send a message via ICQ to SerranoG Send a message via AIM to SerranoG
Default

Make the textbox UNbound, then put that criteria in your recordsource property. Because you put the textbox's recordsource equal to [Procedure] (i.e. bound), it's overriding your assignment.

If you rather not show anything there you can put

=Iif([Category] = "Glasses", [Procedure], Null)

or

=Iif([Category] = "Glasses", [Procedure], "")

Because you're working in a report, assigning NULL or "" won't make a difference on a print-out. If you were working in a form, THEN there would be a difference and you'd have to be careful which you want.


Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division
 
Old July 12th, 2004, 07:49 PM
Registered User
 
Join Date: Jul 2004
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Greg,

Null and "" didn't help. The report that I have right now looks like this:

=======================
Column A Column B
Record 1
Record 2
             Record 3
             Record 4
=======================

What I want is:

=======================
Column A Column B
Record 1 Record 3
Record 2 Record 4
=======================

So to elimate the space there, and to be able to print out on the same sheet of paper.

I did use the unbound text box with the iif statement. Any idea how to do that?

Thank you.

Loke




Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I make this a IIF Statement Corey Access VBA 1 November 3rd, 2006 08:40 AM
Iif statement in Access rangeview Access 7 March 28th, 2006 01:14 PM
iif Statement giving me a headache! MrMacca BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 January 7th, 2005 05:49 AM
IIF Statement golden Access 2 August 3rd, 2004 01:32 AM
IIF Statement Question fastcorvette Access 8 October 31st, 2003 11:01 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.