473,545 Members | 1,638 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3059
Put the following expression in an empty field in the query your report is based
on:

TxtDecision:Swi tch([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******@pcdata sheet.com
www.pcdatasheet.com
"Colin McGuire" <co***********@ lycos.co.uk> wrote in message
news:ab******** *************** ***@posting.goo gle.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 #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","Ma ybe")
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.Deci sion, 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***********@l ycos.co.uk (Colin McGuire) wrote in message news:<ab******* *************** ****@posting.go ogle.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_Pag e" event.

Private Sub Report_Page()
Text51.Text="so mething" '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.go ogle.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.Deci sion, 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***********@l ycos.co.uk (Colin McGuire) wrote in message news:<ab******* *************** ****@posting.go ogle.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_Pag e" event.

Private Sub Report_Page()
Text51.Text="so mething" '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.go ogle.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.Deci sion, 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***********@l ycos.co.uk (Colin McGuire) wrote in message news:<ab******* *************** ****@posting.go ogle.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","Ma ybe")

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","Ma ybe")") 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******@examp le.invalid> wrote in message
news:uc******** *************** *****@40tude.ne t... 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_Pag e" event.

Private Sub Report_Page()
Text51.Text="so mething" '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.go ogle.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.Deci sion, 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***********@l ycos.co.uk (Colin McGuire) wrote in message news:<ab******* *************** ****@posting.go ogle.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","Ma ybe")

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","Ma ybe")

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","Ma ybe")") 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","Ma ybe")
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","Ma ybe")
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","Ma ybe")
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","Ma ybe")

or, using code ...

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

Thank you again for this and future help.
Colin

"fredg" <fg******@examp le.invalid> wrote in message
news:uc******** *************** *****@40tude.ne t...
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_Pag e" event.

Private Sub Report_Page()
Text51.Text="so mething" '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.go ogle.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.Deci sion, 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***********@l ycos.co.uk (Colin McGuire) wrote in message news:<ab******* *************** ****@posting.go ogle.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","Ma ybe")

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 "=localfuncText Value(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","Ma ybe")") 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******@examp le.invalid> wrote in message
news:uc******** *************** *****@40tude.ne t...
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_Pag e" event.

Private Sub Report_Page()
Text51.Text="so mething" '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.go ogle.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.Deci sion, 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***********@l ycos.co.uk (Colin McGuire) wrote in message news:<ab******* *************** ****@posting.go ogle.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","Ma ybe")

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@epsomdot comdotau> wrote in message news:<41******* *************** *@news.syd.swif tdsl.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 "=localfuncText Value(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","Ma ybe")") 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******@examp le.invalid> wrote in message
news:uc******** *************** *****@40tude.ne t...
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_Pag e" event.
>
> Private Sub Report_Page()
> Text51.Text="so mething" '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.go ogle.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.Deci sion, 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***********@l ycos.co.uk (Colin McGuire) wrote in message news:<ab******* *************** ****@posting.go ogle.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","Ma ybe")

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
4306
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 using a report I created and then printing them on a continuous-feed dot matrix printer. I used the Label Wizard, chose the query I created, picked the...
16
48836
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 a commercial program such as Adobe Acrobat and its associated API. The technique uses Ghostscript and Redirection Port Monitor - two free...
1
1518
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 Access database. Is there some way - such as a SQL satement added to a query already set up in Access - to add a statement such as 'if 1 then 'Smith',...
1
5070
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 crystal reports viewer. This report needs to be printed. Its that simple! I would like to use the report.printtoprinter method as this is direct
6
2204
by: MJ | last post by:
Is it possible to print varying numbers of labels from Access?
4
5889
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 hosting my application. Step 1) The user clicks the Print icon in the web page
3
2353
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 is .... or even update strings like Page 1 or 10 ... Page 2 of 10 etc .... When starting the report I don't know the total number of pages nor...
18
11268
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 classes, for each of the checked rows in the GridView. This works fine in the Visual Studio 2005 development environment on localhost. But, when I...
0
2824
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 printing printing data and the actual database data in a recordset. the class looks like this: Public Class BRPDD 'Balance Report PrintingDocument Data ...
0
7653
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7411
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7749
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5322
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4942
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3444
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1871
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1012
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
695
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.