By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,789 Members | 1,447 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,789 IT Pros & Developers. It's quick & easy.

Conditional state of a record

P: n/a
aww
Hi,

I have four records displayed for one client with four different dates and
four different services. One of those services requires I send additional
information.

I created a query that labels the special service with "Attached", while
the other services are labeled "None":
IIF([service]="64","Attached","None").

I tried to set a control in my report that would display the words
"Attached" if the special service happen to occur.

However the problem seems to be that Access selects the label at random. So
even if the special service occurs, my control displays "None".

Any ideas will be greatly appreciated.

aww
--
Many Thanks!
Nov 12 '05 #1
Share this Question
Share on Google+
4 Replies

P: n/a
aww <aww@no_spam.com> wrote in
news:EA*****************@newsread1.news.pas.earthl ink.net:
Hi,

I have four records displayed for one client with four
different dates and four different services. One of those
services requires I send additional information.

I created a query that labels the special service with
"Attached", while the other services are labeled "None":
IIF([service]="64","Attached","None").
This implies that service is a field in the table of type text.
The entry "64" leads me to suspect that it may be defined as a
number in the table. If this is the case, modify the IIF to check
IIF(service = 64, "Attached", "None")

Bob Q.


I tried to set a control in my report that would display the
words "Attached" if the special service happen to occur.

However the problem seems to be that Access selects the label
at random. So even if the special service occurs, my control
displays "None".

Any ideas will be greatly appreciated.

aww


Nov 12 '05 #2

P: n/a
DFS
"aww" <aww@no_spam.com> wrote in message
news:EA*****************@newsread1.news.pas.earthl ink.net...
Hi,

I have four records displayed for one client with four different dates and
four different services. One of those services requires I send additional
information.

I created a query that labels the special service with "Attached", while
the other services are labeled "None":
IIF([service]="64","Attached","None").

aww,

If your report uses that query (you didn't show the whole thing), just bind
a text box on the report to the column resulting from the iif() statement.



I tried to set a control in my report that would display the words
"Attached" if the special service happen to occur.

However the problem seems to be that Access selects the label at random. So even if the special service occurs, my control displays "None".

Any ideas will be greatly appreciated.

aww
--
Many Thanks!

Nov 12 '05 #3

P: n/a
aww
DFS wrote:
aww,

If your report uses that query (you didn't show the whole thing), just
bind a text box on the report to the column resulting from the iif()
statement.


Hi DFS,

The report does use the query. The query is based on a one-2-many
relationship: A recordset displays one client, and also displays many (4)
services for said client. Ofcourse, only the selected client is shown.

The query has an expression that "marks" each of the services provided:

=============================
|Client | service | Mark |
=============================
| 1234 | 61 | None |
| 1234 | 64 | Attached |
| 1234 | 67 | None |
| 1234 | 69 | None |
-----------------------------

The report has a textbox which binds the field "Mark". However, it will
randomly display any of the labels instead of just the "Attached" label, I
haven't figured out how show ONLY this label.

--
Many Thanks!
Nov 12 '05 #4

P: n/a
aww
aww wrote:
Hi,

I have four records displayed for one client with four different dates and
four different services. One of those services requires I send additional
information.

I created a query that labels the special service with "Attached", while
the other services are labeled "None":
IIF([service]="64","Attached","None").

I tried to set a control in my report that would display the words
"Attached" if the special service happen to occur.

However the problem seems to be that Access selects the label at random.
So even if the special service occurs, my control displays "None".

Any ideas will be greatly appreciated.

aww


I've come up with a good solution.

In the query that populates the report, I created a calculated field with
the following:

Mark: IIf([service]= "64","2","1")

Then I used this field to manipulate the control in the report:

=IIf(Max([Mark]="2","Attached","None")
--
Many Thanks!
Nov 12 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.