Re: Option Group Question

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



On Fri, 15 Feb 2008 08:49:02 -0800, Stockwell43 wrote:

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" wrote:

On Thu, 14 Feb 2008 13:31:00 -0800, Stockwell43 wrote:

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")
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail


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.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
.



Relevant Pages

  • Re: Calculation
    ... Working through your proposed suggestion will ... which is for 365 days after the closing date. ... Create a query using your existing table ... Drag tblDate.TheDate onto the date field from date field in the query. ...
    (microsoft.public.access.forms)
  • Re: SQL query help
    ... Check out http://www.aspfaq.com/etiquette.asp?id=5006 on how to post DDL ... and example data for your tables, along with the expected output from your ... I have a table with products and closing dates for each of 4 quarters ... I need a query that will look at earning_dates and return the latest 6 ...
    (comp.databases.ms-sqlserver)
  • Re: Enter Parameter Value
    ... The query the report is based on uses the values of the controls on the ... that pops up after closing my query dialog form. ... I have gone back and looked at my query, the record source of my combo ...
    (microsoft.public.access.queries)
  • back to main menu
    ... >Are you closing each of the menu forms as you open the ... >next one or are you just opening the next form? ... >to just Open it from a command button. ... >>select a Query Menu form, ...
    (microsoft.public.access.forms)
  • Re: switchboard problem
    ... That makes sense - I was opening the form, running the query and attempting ... to run the report before closing the form, I got the correct information ...
    (microsoft.public.access.reports)