473,385 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

printing Yes, No, Maybe from the numbers 1, 2, and 3 using an Access report

Hi, I have an report in Microsoft Access and it displays everything in
the table. One column called "DECISION" in the table has either 1,2,
or 3 in it. On my report it displays 1, 2, or 3. I want to appear in
the report is Yes, No, or Maybe. What do I need to do to change what
appears in the report/what term do I need to search out in Google?
Thank you
Colin
Nov 13 '05 #1
9 3046
Put the following expression in an empty field in the query your report is based
on:

TxtDecision:Switch([Decision]=1,"Yes",[Decision]=2,"No",[Decision]=3,"Maybe")

Then add TxtDecision as a field in your report.

Note: If 1, 2 and 3 are text, then enclose them in quotes in the Switch
expression.

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
"Colin McGuire" <co***********@lycos.co.uk> wrote in message
news:ab**************************@posting.google.c om...
Hi, I have an report in Microsoft Access and it displays everything in
the table. One column called "DECISION" in the table has either 1,2,
or 3 in it. On my report it displays 1, 2, or 3. I want to appear in
the report is Yes, No, or Maybe. What do I need to do to change what
appears in the report/what term do I need to search out in Google?
Thank you
Colin

Nov 13 '05 #2
On 30 Jul 2004 07:08:52 -0700, Colin McGuire wrote:
Hi, I have an report in Microsoft Access and it displays everything in
the table. One column called "DECISION" in the table has either 1,2,
or 3 in it. On my report it displays 1, 2, or 3. I want to appear in
the report is Yes, No, or Maybe. What do I need to do to change what
appears in the report/what term do I need to search out in Google?
Thank you
Colin


In your report, add an unbound control to the report.
Set it's control source to:
=Choose([Decision],"Yes","No","Maybe")
or ....
You could also use:
=IIf([Decision]=1,"Yes",IIf([Decision]=2,"No","Maybe"))
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 13 '05 #3
Someone out there is going to give you a nested IIF statement that is
going to work really nicely. In case they don't try this.

Create a function in a module like this:

Public Function YNM(i As Integer) As String
'YesNoMaybe
Dim strResponse As String

Select Case i
Case 1
strResponse = "Yes"

Case 2
strResponse = "No"

Case 3
strResponse = "Maybe"

End Select

YNM = strResponse

End Function

Then create a query with a calculated field

DecisionText: YNM([Decision])

The SQL for this would be

SELECT tblMyTable.Decision, YNM([Decision]) AS DecisionText
FROM tblMyTable;

That ought to do it! Any questions post again.

If you don't like my solution try looking up Nested IIF's in a query
on Google.

co***********@lycos.co.uk (Colin McGuire) wrote in message news:<ab**************************@posting.google. com>...
Hi, I have an report in Microsoft Access and it displays everything in
the table. One column called "DECISION" in the table has either 1,2,
or 3 in it. On my report it displays 1, 2, or 3. I want to appear in
the report is Yes, No, or Maybe. What do I need to do to change what
appears in the report/what term do I need to search out in Google?
Thank you
Colin

Nov 13 '05 #4
Thanks for the ways of doing this.

I want to do it like this though.

I want to put an unbound control like a textbox on the report and then
set the "Yes", "No", "Maybe" using VBA. Can this be done?

Here is what I have that isn't working rather than the whole thing.

1. I put a new textbox on the report (called Text51)
2. I have the following in the "Report_Page" event.

Private Sub Report_Page()
Text51.Text="something" 'will be one of Yes,No,Maybe with some VBA
End Sub 'once I get this little bit working.

Text51 doesn't seem to have a Text or Value property and VBA is giving
me an error.


du********@aol.com (Ed Marzan) wrote in message news:<cc**************************@posting.google. com>...
Someone out there is going to give you a nested IIF statement that is
going to work really nicely. In case they don't try this.

Create a function in a module like this:

Public Function YNM(i As Integer) As String
'YesNoMaybe
Dim strResponse As String

Select Case i
Case 1
strResponse = "Yes"

Case 2
strResponse = "No"

Case 3
strResponse = "Maybe"

End Select

YNM = strResponse

End Function

Then create a query with a calculated field

DecisionText: YNM([Decision])

The SQL for this would be

SELECT tblMyTable.Decision, YNM([Decision]) AS DecisionText
FROM tblMyTable;

That ought to do it! Any questions post again.

If you don't like my solution try looking up Nested IIF's in a query
on Google.

co***********@lycos.co.uk (Colin McGuire) wrote in message news:<ab**************************@posting.google. com>...
Hi, I have an report in Microsoft Access and it displays everything in
the table. One column called "DECISION" in the table has either 1,2,
or 3 in it. On my report it displays 1, 2, or 3. I want to appear in
the report is Yes, No, or Maybe. What do I need to do to change what
appears in the report/what term do I need to search out in Google?
Thank you
Colin

Nov 13 '05 #5
On 31 Jul 2004 00:03:31 -0700, Colin McGuire wrote:
Thanks for the ways of doing this.

I want to do it like this though.

I want to put an unbound control like a textbox on the report and then
set the "Yes", "No", "Maybe" using VBA. Can this be done?

Here is what I have that isn't working rather than the whole thing.

1. I put a new textbox on the report (called Text51)
2. I have the following in the "Report_Page" event.

Private Sub Report_Page()
Text51.Text="something" 'will be one of Yes,No,Maybe with some VBA
End Sub 'once I get this little bit working.

Text51 doesn't seem to have a Text or Value property and VBA is giving
me an error.

du********@aol.com (Ed Marzan) wrote in message news:<cc**************************@posting.google. com>...
Someone out there is going to give you a nested IIF statement that is
going to work really nicely. In case they don't try this.

Create a function in a module like this:

Public Function YNM(i As Integer) As String
'YesNoMaybe
Dim strResponse As String

Select Case i
Case 1
strResponse = "Yes"

Case 2
strResponse = "No"

Case 3
strResponse = "Maybe"

End Select

YNM = strResponse

End Function

Then create a query with a calculated field

DecisionText: YNM([Decision])

The SQL for this would be

SELECT tblMyTable.Decision, YNM([Decision]) AS DecisionText
FROM tblMyTable;

That ought to do it! Any questions post again.

If you don't like my solution try looking up Nested IIF's in a query
on Google.

co***********@lycos.co.uk (Colin McGuire) wrote in message news:<ab**************************@posting.google. com>...
Hi, I have an report in Microsoft Access and it displays everything in
the table. One column called "DECISION" in the table has either 1,2,
or 3 in it. On my report it displays 1, 2, or 3. I want to appear in
the report is Yes, No, or Maybe. What do I need to do to change what
appears in the report/what term do I need to search out in Google?
Thank you
Colin


1) If it is a text control (unbound or otherwise) it does have a Value
property.
It's what ever value is returned by the control's control source, i,e,
= "This is it's value.", or a value in a bound field.

2) You're getting your error because you're using the wrong event.
Why are you attempting this in the Page event?

3) Where have you placed the unbound control [Text51]?
In the Detail Section?
Code the Detail Format event:
[Text51] =Choose([Decision],"Yes","No","Maybe")

I don't see any advantage to using code to write the value as opposed
to simply placing the expression directly into the control's control
source, as long as the [Decision] field is a field in the report's
record source.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 13 '05 #6

Thanks for your quick help. Here are more questions because I still can't
get this simple thing going.
2) You're getting your error because you're using the wrong event.
Why are you attempting this in the Page event?
What other event should it be/should I use? (I am not trying to be being
cute, I just don't know) Every row that is printed I want to determine Yes,
No, or Maybe from a number. This subroutine is called (see my "test" below)
every time a new row in the table is used for the report.

The reason I want to do it in VBA rather than using things like this
("[Text51] =Choose([Decision],"Yes","No","Maybe")") is that I know VBA and
although it doesn't look too cryptic, I still want to avoid the hassle of
finding out how to use the syntax/query builder etc
3) Where have you placed the unbound control [Text51]?
In the Detail Section? Yes.

When I type in the following (you suggested using the Value property),
"anything" does not appear on the report but a message box is displayed with
"test" in it for every row in the table meaning the it is called correctly.

Private Sub Report_Page()
MsgBox "test"
Text51.Value = "anything"

So no further ahead.

When you sum it all up, I want to set what appears in the textbox on a
report using VBA at runtime. The Yes, No, Maybe bit is a bit of a red
herring.

Thank you again for this and future help.
Colin
"fredg" <fg******@example.invalid> wrote in message
news:uc****************************@40tude.net... On 31 Jul 2004 00:03:31 -0700, Colin McGuire wrote:
Thanks for the ways of doing this.

I want to do it like this though.

I want to put an unbound control like a textbox on the report and then
set the "Yes", "No", "Maybe" using VBA. Can this be done?

Here is what I have that isn't working rather than the whole thing.

1. I put a new textbox on the report (called Text51)
2. I have the following in the "Report_Page" event.

Private Sub Report_Page()
Text51.Text="something" 'will be one of Yes,No,Maybe with some VBA
End Sub 'once I get this little bit working.

Text51 doesn't seem to have a Text or Value property and VBA is giving
me an error.

du********@aol.com (Ed Marzan) wrote in message news:<cc**************************@posting.google. com>...
Someone out there is going to give you a nested IIF statement that is
going to work really nicely. In case they don't try this.

Create a function in a module like this:

Public Function YNM(i As Integer) As String
'YesNoMaybe
Dim strResponse As String

Select Case i
Case 1
strResponse = "Yes"

Case 2
strResponse = "No"

Case 3
strResponse = "Maybe"

End Select

YNM = strResponse

End Function

Then create a query with a calculated field

DecisionText: YNM([Decision])

The SQL for this would be

SELECT tblMyTable.Decision, YNM([Decision]) AS DecisionText
FROM tblMyTable;

That ought to do it! Any questions post again.

If you don't like my solution try looking up Nested IIF's in a query
on Google.

co***********@lycos.co.uk (Colin McGuire) wrote in message news:<ab**************************@posting.google. com>... Hi, I have an report in Microsoft Access and it displays everything in
the table. One column called "DECISION" in the table has either 1,2,
or 3 in it. On my report it displays 1, 2, or 3. I want to appear in
the report is Yes, No, or Maybe. What do I need to do to change what
appears in the report/what term do I need to search out in Google?
Thank you
Colin


1) If it is a text control (unbound or otherwise) it does have a Value
property.
It's what ever value is returned by the control's control source, i,e,
= "This is it's value.", or a value in a bound field.

2) You're getting your error because you're using the wrong event.
Why are you attempting this in the Page event?

3) Where have you placed the unbound control [Text51]?
In the Detail Section?
Code the Detail Format event:
[Text51] =Choose([Decision],"Yes","No","Maybe")

I don't see any advantage to using code to write the value as opposed
to simply placing the expression directly into the control's control
source, as long as the [Decision] field is a field in the report's
record source.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.

Nov 13 '05 #7

Please see my comments interspersed with your questions below.

On Sat, 31 Jul 2004 18:14:30 +0100, Colin McGuire wrote:
Thanks for your quick help. Here are more questions because I still can't
get this simple thing going.
2) You're getting your error because you're using the wrong event.
Why are you attempting this in the Page event?
What other event should it be/should I use? (I am not trying to be being
cute, I just don't know) Every row that is printed I want to determine Yes,
No, or Maybe from a number. This subroutine is called (see my "test" below)
every time a new row in the table is used for the report.


I specifically answered this in my reply, quoted below ....

* 3) Where have you placed the unbound control [Text51]?
* In the Detail Section?
* **** Code the Detail Format event: ****
* [Text51] =Choose([Decision],"Yes","No","Maybe")

If the control is placed in the Detail section, you place the code in
the Detail Format event.
The reason I want to do it in VBA rather than using things like this
("[Text51] =Choose([Decision],"Yes","No","Maybe")") is that I know VBA and
although it doesn't look too cryptic, I don't understand this above comment.
The statement:
[Text51] =Choose([Decision],"Yes","No","Maybe")
placed in an event code IS VBA, which you say you know.
I still want to avoid the hassle of
finding out how to use the syntax/query builder etc What hassle? Why the query builder?
If you wish to get an unbound control to display a value, you write
the expression directly into it's control source.
I gave you previously 2 expressions, either one of which will work.
You write it, exactly as I gave it to you, directly on the control's
control source property line, either:

=Choose([Decision],"Yes","No","Maybe")
or
=IIf([Decision]=1,"Yes",IIf([Decision]=2,"No","Maybe"))

3) Where have you placed the unbound control [Text51]?
In the Detail Section?

Yes.

When I type in the following (you suggested using the Value property),
"anything" does not appear on the report but a message box is displayed with
"test" in it for every row in the table meaning the it is called correctly.


No I didn't suggest using the value property.
I suggested you write:
=Choose([Decision],"Yes","No","Maybe")
as the controls Source property of the unbound control.
The Choose function then returns a value to the control, either "Yes",
"No", or "Maybe", depending upon the value in the [Decision] field.
Private Sub Report_Page()
MsgBox "test"
Text51.Value = "anything"
You're problem, using the Page event, is that you can't change a
control's value in the Page event. It's too late. You have to use the
Detail Format (or Print) event. I use the Format event.
So no further ahead.

When you sum it all up, I want to set what appears in the textbox on a
report using VBA at runtime. The Yes, No, Maybe bit is a bit of a red
herring.
I'll give it to you once more.
If you wish an unbound control, placed in the report's detail section,
to print specific words in place of numbers, either one of these two
things will work.

1) As the CONTROLSOURCE of an unbound control placed in the Report's
Detail section, write:
=Choose([Decision],"Yes","No","Maybe")

or, using code ...

2) Use code, placed in the DETAIL FORMAT event:
[Text51] = Choose([Decision],"Yes","No","Maybe")

Thank you again for this and future help.
Colin

"fredg" <fg******@example.invalid> wrote in message
news:uc****************************@40tude.net...
On 31 Jul 2004 00:03:31 -0700, Colin McGuire wrote:
Thanks for the ways of doing this.

I want to do it like this though.

I want to put an unbound control like a textbox on the report and then
set the "Yes", "No", "Maybe" using VBA. Can this be done?

Here is what I have that isn't working rather than the whole thing.

1. I put a new textbox on the report (called Text51)
2. I have the following in the "Report_Page" event.

Private Sub Report_Page()
Text51.Text="something" 'will be one of Yes,No,Maybe with some VBA
End Sub 'once I get this little bit working.

Text51 doesn't seem to have a Text or Value property and VBA is giving
me an error.

du********@aol.com (Ed Marzan) wrote in message news:<cc**************************@posting.google. com>... Someone out there is going to give you a nested IIF statement that is
going to work really nicely. In case they don't try this.

Create a function in a module like this:

Public Function YNM(i As Integer) As String
'YesNoMaybe
Dim strResponse As String

Select Case i
Case 1
strResponse = "Yes"

Case 2
strResponse = "No"

Case 3
strResponse = "Maybe"

End Select

YNM = strResponse

End Function

Then create a query with a calculated field

DecisionText: YNM([Decision])

The SQL for this would be

SELECT tblMyTable.Decision, YNM([Decision]) AS DecisionText
FROM tblMyTable;

That ought to do it! Any questions post again.

If you don't like my solution try looking up Nested IIF's in a query
on Google.

co***********@lycos.co.uk (Colin McGuire) wrote in message news:<ab**************************@posting.google. com>...> Hi, I have an report in Microsoft Access and it displays everything in
> the table. One column called "DECISION" in the table has either 1,2,
> or 3 in it. On my report it displays 1, 2, or 3. I want to appear in
> the report is Yes, No, or Maybe. What do I need to do to change what
> appears in the report/what term do I need to search out in Google?
> Thank you
> Colin


1) If it is a text control (unbound or otherwise) it does have a Value
property.
It's what ever value is returned by the control's control source, i,e,
= "This is it's value.", or a value in a bound field.

2) You're getting your error because you're using the wrong event.
Why are you attempting this in the Page event?

3) Where have you placed the unbound control [Text51]?
In the Detail Section?
Code the Detail Format event:
[Text51] =Choose([Decision],"Yes","No","Maybe")

I don't see any advantage to using code to write the value as opposed
to simply placing the expression directly into the control's control
source, as long as the [Decision] field is a field in the report's
record source.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.

--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 13 '05 #8
You don't (?) normally change the value of a text box in a report.
What you do is Set the Control Source, and the value comes from the
control source. You can only set the control source before the
report is displayed (in the open event normally).

Or you can set the caption on a label.

For what you are doing, using label.caption seems to be appropriate.

For more complex situations, you may wish to set the control source
of a text box to something like "=localfuncTextValue(idxRecord,idxValue)"
Which is more or less equivalent to using a function in the query,
but allows you to use a VBA function that is in the report module,
and lets you put different functions on different controls.

(david)
"Colin McGuire" <co***********@lycos.co.uk> wrote in message
news:10****************@lotis.uk.clara.net...

Thanks for your quick help. Here are more questions because I still can't
get this simple thing going.
2) You're getting your error because you're using the wrong event.
Why are you attempting this in the Page event?
What other event should it be/should I use? (I am not trying to be being
cute, I just don't know) Every row that is printed I want to determine

Yes, No, or Maybe from a number. This subroutine is called (see my "test" below) every time a new row in the table is used for the report.

The reason I want to do it in VBA rather than using things like this
("[Text51] =Choose([Decision],"Yes","No","Maybe")") is that I know VBA and
although it doesn't look too cryptic, I still want to avoid the hassle of
finding out how to use the syntax/query builder etc
3) Where have you placed the unbound control [Text51]?
In the Detail Section? Yes.

When I type in the following (you suggested using the Value property),
"anything" does not appear on the report but a message box is displayed

with "test" in it for every row in the table meaning the it is called correctly.
Private Sub Report_Page()
MsgBox "test"
Text51.Value = "anything"

So no further ahead.

When you sum it all up, I want to set what appears in the textbox on a
report using VBA at runtime. The Yes, No, Maybe bit is a bit of a red
herring.

Thank you again for this and future help.
Colin
"fredg" <fg******@example.invalid> wrote in message
news:uc****************************@40tude.net...
On 31 Jul 2004 00:03:31 -0700, Colin McGuire wrote:
Thanks for the ways of doing this.

I want to do it like this though.

I want to put an unbound control like a textbox on the report and then
set the "Yes", "No", "Maybe" using VBA. Can this be done?

Here is what I have that isn't working rather than the whole thing.

1. I put a new textbox on the report (called Text51)
2. I have the following in the "Report_Page" event.

Private Sub Report_Page()
Text51.Text="something" 'will be one of Yes,No,Maybe with some VBA
End Sub 'once I get this little bit working.

Text51 doesn't seem to have a Text or Value property and VBA is giving
me an error.

du********@aol.com (Ed Marzan) wrote in message news:<cc**************************@posting.google. com>...> Someone out there is going to give you a nested IIF statement that is
> going to work really nicely. In case they don't try this.
>
> Create a function in a module like this:
>
> Public Function YNM(i As Integer) As String
> 'YesNoMaybe
> Dim strResponse As String
>
> Select Case i
> Case 1
> strResponse = "Yes"
>
> Case 2
> strResponse = "No"
>
> Case 3
> strResponse = "Maybe"
>
> End Select
>
> YNM = strResponse
>
> End Function
>
> Then create a query with a calculated field
>
> DecisionText: YNM([Decision])
>
> The SQL for this would be
>
> SELECT tblMyTable.Decision, YNM([Decision]) AS DecisionText
> FROM tblMyTable;
>
> That ought to do it! Any questions post again.
>
> If you don't like my solution try looking up Nested IIF's in a query
> on Google.
>
> co***********@lycos.co.uk (Colin McGuire) wrote in message news:<ab**************************@posting.google. com>...>> Hi, I have an report in Microsoft Access and it displays everything in>> the table. One column called "DECISION" in the table has either 1,2,
>> or 3 in it. On my report it displays 1, 2, or 3. I want to appear in
>> the report is Yes, No, or Maybe. What do I need to do to change what
>> appears in the report/what term do I need to search out in Google?
>> Thank you
>> Colin


1) If it is a text control (unbound or otherwise) it does have a Value
property.
It's what ever value is returned by the control's control source, i,e,
= "This is it's value.", or a value in a bound field.

2) You're getting your error because you're using the wrong event.
Why are you attempting this in the Page event?

3) Where have you placed the unbound control [Text51]?
In the Detail Section?
Code the Detail Format event:
[Text51] =Choose([Decision],"Yes","No","Maybe")

I don't see any advantage to using code to write the value as opposed
to simply placing the expression directly into the control's control
source, as long as the [Decision] field is a field in the report's
record source.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.


Nov 13 '05 #9
Hi Colin,

Isn't the NG great? I really like the nested IIF statement as it seems
very elegant and simple.

=IIf([Decision]=1,"Yes",IIf([Decision]=2,"No","Maybe"))
You state that you wanted the answer written in VBA. I think my corney
little function satisfies that requirement. Post again if you have any
more questions and good luck.

HTH!
"david epsom dot com dot au" <david@epsomdotcomdotau> wrote in message news:<41***********************@news.syd.swiftdsl. com.au>...
You don't (?) normally change the value of a text box in a report.
What you do is Set the Control Source, and the value comes from the
control source. You can only set the control source before the
report is displayed (in the open event normally).

Or you can set the caption on a label.

For what you are doing, using label.caption seems to be appropriate.

For more complex situations, you may wish to set the control source
of a text box to something like "=localfuncTextValue(idxRecord,idxValue)"
Which is more or less equivalent to using a function in the query,
but allows you to use a VBA function that is in the report module,
and lets you put different functions on different controls.

(david)
"Colin McGuire" <co***********@lycos.co.uk> wrote in message
news:10****************@lotis.uk.clara.net...

Thanks for your quick help. Here are more questions because I still can't
get this simple thing going.
2) You're getting your error because you're using the wrong event.
Why are you attempting this in the Page event?


What other event should it be/should I use? (I am not trying to be being
cute, I just don't know) Every row that is printed I want to determine

Yes,
No, or Maybe from a number. This subroutine is called (see my "test"

below)
every time a new row in the table is used for the report.

The reason I want to do it in VBA rather than using things like this
("[Text51] =Choose([Decision],"Yes","No","Maybe")") is that I know VBA and
although it doesn't look too cryptic, I still want to avoid the hassle of
finding out how to use the syntax/query builder etc
3) Where have you placed the unbound control [Text51]?
In the Detail Section?

Yes.

When I type in the following (you suggested using the Value property),
"anything" does not appear on the report but a message box is displayed

with
"test" in it for every row in the table meaning the it is called

correctly.

Private Sub Report_Page()
MsgBox "test"
Text51.Value = "anything"

So no further ahead.

When you sum it all up, I want to set what appears in the textbox on a
report using VBA at runtime. The Yes, No, Maybe bit is a bit of a red
herring.

Thank you again for this and future help.
Colin
"fredg" <fg******@example.invalid> wrote in message
news:uc****************************@40tude.net...
On 31 Jul 2004 00:03:31 -0700, Colin McGuire wrote:

> Thanks for the ways of doing this.
>
> I want to do it like this though.
>
> I want to put an unbound control like a textbox on the report and then
> set the "Yes", "No", "Maybe" using VBA. Can this be done?
>
> Here is what I have that isn't working rather than the whole thing.
>
> 1. I put a new textbox on the report (called Text51)
> 2. I have the following in the "Report_Page" event.
>
> Private Sub Report_Page()
> Text51.Text="something" 'will be one of Yes,No,Maybe with some VBA
> End Sub 'once I get this little bit working.
>
> Text51 doesn't seem to have a Text or Value property and VBA is giving
> me an error.
>
> du********@aol.com (Ed Marzan) wrote in message news:<cc**************************@posting.google. com>... >> Someone out there is going to give you a nested IIF statement that is
>> going to work really nicely. In case they don't try this.
>>
>> Create a function in a module like this:
>>
>> Public Function YNM(i As Integer) As String
>> 'YesNoMaybe
>> Dim strResponse As String
>>
>> Select Case i
>> Case 1
>> strResponse = "Yes"
>>
>> Case 2
>> strResponse = "No"
>>
>> Case 3
>> strResponse = "Maybe"
>>
>> End Select
>>
>> YNM = strResponse
>>
>> End Function
>>
>> Then create a query with a calculated field
>>
>> DecisionText: YNM([Decision])
>>
>> The SQL for this would be
>>
>> SELECT tblMyTable.Decision, YNM([Decision]) AS DecisionText
>> FROM tblMyTable;
>>
>> That ought to do it! Any questions post again.
>>
>> If you don't like my solution try looking up Nested IIF's in a query
>> on Google.
>>
>> co***********@lycos.co.uk (Colin McGuire) wrote in message news:<ab**************************@posting.google. com>... >>> Hi, I have an report in Microsoft Access and it displays everything in >>> the table. One column called "DECISION" in the table has either 1,2,
>>> or 3 in it. On my report it displays 1, 2, or 3. I want to appear in
>>> the report is Yes, No, or Maybe. What do I need to do to change what
>>> appears in the report/what term do I need to search out in Google?
>>> Thank you
>>> Colin

1) If it is a text control (unbound or otherwise) it does have a Value
property.
It's what ever value is returned by the control's control source, i,e,
= "This is it's value.", or a value in a bound field.

2) You're getting your error because you're using the wrong event.
Why are you attempting this in the Page event?

3) Where have you placed the unbound control [Text51]?
In the Detail Section?
Code the Detail Format event:
[Text51] =Choose([Decision],"Yes","No","Maybe")

I don't see any advantage to using code to write the value as opposed
to simply placing the expression directly into the control's control
source, as long as the [Decision] field is a field in the report's
record source.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.


Nov 13 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Grim Reaper | last post by:
I print mailing labels out of Access 2000 databases about 3 to 4 times a week. I have been having problems with one thing since I have been printing mailing labels. I print mailing labels by...
16
by: cyranoVR | last post by:
This is the approach I used to automate printing of Microsoft Access reports to PDF format i.e. unattended and without annoying "Save As..." dialogs, and - more importantly - without having to use...
1
by: kmnotes04 | last post by:
I have a data entry form that contains drop-down lists such as 'Assigned to:' with a list of staff member names. Those names end up as numerical codes in the main table ('ProjectInfo') of the...
1
by: Dreamtime | last post by:
Hi I am using Visual Studio 2005 and the bundled Crystal Reports (previously I used .net 2003 and bundled Crystal Reports for 2 years - same issues!) I have a report which is displayed in the...
6
by: MJ | last post by:
Is it possible to print varying numbers of labels from Access?
4
by: Lucas Ponzo | last post by:
Hi All, I have an ASP.NET 2.0 app. The users access the pages, uniquely via pocket pc ... I need to print a page. But I need that the page print on a printer installed on the web server...
3
by: Kristijan Marin | last post by:
Hi, I need to print a report like document. So in report there are many articles and what I need when I get to the end, is to update page numbers on the second page where the Table of Content...
18
by: Brett | last post by:
I have an ASP.NET page that displays work orders in a GridView. In that GridView is a checkbox column. When the user clicks a "Print" button, I create a report, using the .NET Framework printing...
0
it0ny
by: it0ny | last post by:
Hi guys, thanks I am fairly new to this forum so I hope I chose the right place to post this question. I try to make my program printout a deposit's report. I created a class to store the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.