Option Group Question

S

Stockwell43

Hello,

I am using an option Group for the first time and have a question as to
translating the Assigned Option Group "Number" to an acutual word on the
report.

Example:

In my option group "Closing" is assigned number 1 and "Doc Prep" is assigned
number 2. The number come through on the table but also on the query. Is
there a way to make the 1 say Closing so on the report management knows what
it is?

Thanks!!!
 
F

fredg

Hello,

I am using an option Group for the first time and have a question as to
translating the Assigned Option Group "Number" to an acutual word on the
report.

Example:

In my option group "Closing" is assigned number 1 and "Doc Prep" is assigned
number 2. The number come through on the table but also on the query. Is
there a way to make the 1 say Closing so on the report management knows what
it is?

Thanks!!!

Sure.
In the query add a new column to the grid.

TheText:Choose([OptionGroupName],"Closing","Doc Prep")

You could also do this directly in the report instead of the query.
Just use an unbound control. Set it's control source to:
= Choose([OptionGroupName],"Closing","Doc Prep")

Also, you could use an IIF statement instead of Choose(), in the query
or in the report, assuming 1 or 2 are the only options:

IIf([OptionGroupName] = 1,"Closing","Doc Prep")
 
S

Stockwell43

Hi Fred, thank you for responding!

Code works great! I did the first one and put it in the query. When I run
the query it now says Closing And/Or Doc Prep instead of 1 And/Or 2. The only
other thing is, if I want to pull ONLY the records marked "Closing", how do I
do that?

Thanks!!!

fredg said:
Hello,

I am using an option Group for the first time and have a question as to
translating the Assigned Option Group "Number" to an acutual word on the
report.

Example:

In my option group "Closing" is assigned number 1 and "Doc Prep" is assigned
number 2. The number come through on the table but also on the query. Is
there a way to make the 1 say Closing so on the report management knows what
it is?

Thanks!!!

Sure.
In the query add a new column to the grid.

TheText:Choose([OptionGroupName],"Closing","Doc Prep")

You could also do this directly in the report instead of the query.
Just use an unbound control. Set it's control source to:
= Choose([OptionGroupName],"Closing","Doc Prep")

Also, you could use an IIF statement instead of Choose(), in the query
or in the report, assuming 1 or 2 are the only options:

IIf([OptionGroupName] = 1,"Closing","Doc Prep")
 
F

fredg

Hi Fred, thank you for responding!

Code works great! I did the first one and put it in the query. When I run
the query it now says Closing And/Or Doc Prep instead of 1 And/Or 2. The only
other thing is, if I want to pull ONLY the records marked "Closing", how do I
do that?

Thanks!!!

fredg said:
Hello,

I am using an option Group for the first time and have a question as to
translating the Assigned Option Group "Number" to an acutual word on the
report.

Example:

In my option group "Closing" is assigned number 1 and "Doc Prep" is assigned
number 2. The number come through on the table but also on the query. Is
there a way to make the 1 say Closing so on the report management knows what
it is?

Thanks!!!

Sure.
In the query add a new column to the grid.

TheText:Choose([OptionGroupName],"Closing","Doc Prep")

You could also do this directly in the report instead of the query.
Just use an unbound control. Set it's control source to:
= Choose([OptionGroupName],"Closing","Doc Prep")

Also, you could use an IIF statement instead of Choose(), in the query
or in the report, assuming 1 or 2 are the only options:

IIf([OptionGroupName] = 1,"Closing","Doc Prep")

Include the actual [OptionGroupName] field in the query grid (as well
as the above new column).
As criteria on this field in the query grid, write
1

However, if you should wish to allow the user to select whether to
show Closing or Doc Prep (or even All ) records, change the criteria
to (on 2 consecutive lines):

[Enter 1 for Closing or 2 for Doc Prep or leave blank for All]
[Enter 1 for Closing or 2 for Doc Prep or leave blank for All] Is Null

When prompted, if the user enters 1 only Closing records will display.
If the user enters 2, only Doc Prep records will display.
It the user leaves the prompt blank, all records will display.

Note: If you do not wish to actually show this field in the query,
simply uncheck the Show check box for this column.

A better solution would be to use an unbound Option Group control on a
form to select which records to show. If you have 2 options to choose
from, then add a third button to show all.
In this case you would change the above query criteria on the
[OptionGroupName] field to:

Forms!FormName!OptionControlOnForm
Forms!FormName!OptionControlOnForm = 3

where 3 will return "All" records.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top