1. You can use a parametrised Query as the RecordSource for Report. The
Parameter in the query should be something like:
WHERE (tblKid.[SEX] = [Enter Gender (M or F):])
OR ([Enter Gender (M or F):] Is Null)
If you enter "M", you get the boys. If you enter "F", you get the girls.
If you enter nothing, you get both boys & girls.
2. In the Query you use as the RecordSource for the Labels, you can use a
calculated Field like:
KidTitle: IIf( [SEX] = "M", "Mr", IIf( [SEX] = "F", "Miss", "" ) )
Then you can use this to print the Labels with appropriate KidTitle.
HTH
Van T. Dinh
MVP (Access)
> I'm the registrar for a small summer camp program and I have all the
> kids names, addresses, cabin assignments etc in an Access database. How
[quoted text clipped - 11 lines]
> boys at once with a filter but that would be our first question.
> David
David G - 25 May 2005 19:56 GMT
Van,
You seem to understand exactly what I need to do. I don't understand
where and how to enter a "papametrised Queery" or a RecordSource. Could
you point me to a resource to explain it or tell me how to do that. I
have played with the menu bar and can't find either of those.
David
> 1. You can use a parametrised Query as the RecordSource for Report. The
> Parameter in the query should be something like:
[quoted text clipped - 31 lines]
>>boys at once with a filter but that would be our first question.
>>David
Van T. Dinh - 26 May 2005 13:58 GMT
Check Access Help. I type "Parameter Query" and "RecordSource" in Help and
the right topics come up in the search.
Any Access book will cover these topics also.

Signature
HTH
Van T. Dinh
MVP (Access)
> Van,
> You seem to understand exactly what I need to do. I don't understand
> where and how to enter a "papametrised Queery" or a RecordSource. Could
> you point me to a resource to explain it or tell me how to do that. I
> have played with the menu bar and can't find either of those.
> David
David G - 26 May 2005 18:25 GMT
OK, this may be harder than I thought especially since I don't undertand
all the terms in Access. Is RecordSource is really just the name of
the table my data is coming from?
And in the following statement you sent me:
WHERE (tblKid.[SEX] = [Enter Gender (M or F):])
OR ([Enter Gender (M or F):] Is Null)
is tblKid the name of a table and SEX the name of a field within that
table? I'll try to find a book on this but for a one time deal, it may
not be worth it. Sorry about my ignorance but Access has been the
hardest program I've ever tried to understand, partly because I don't
use it enough.
David
> Check Access Help. I type "Parameter Query" and "RecordSource" in Help and
> the right topics come up in the search.
>
> Any Access book will cover these topics also.
Van T. Dinh - 26 May 2005 23:45 GMT
RowSource (of a Report) can be either a Table, a Query or an SQL String. I
rarely use Tables (some of my Tables have 1M+ Records) as RecordSources and
use Queries or SQL Strings to select only Records that meet certain
criteria. What I post is the criteria to select the required Records using
Query (which translates to an SQL String in the end) or an SQL String as the
RecordSource for the Report.

Signature
HTH
Van T. Dinh
MVP (Access)
> OK, this may be harder than I thought especially since I don't undertand
> all the terms in Access. Is RecordSource is really just the name of
[quoted text clipped - 10 lines]
> use it enough.
> David
David G - 27 May 2005 06:59 GMT
I got the gender select thing to work on the roster, very cool. I
couldn't figure out the label thing so I added another field for "Title"
and made it a combo list box to select either Mr. or Miss. Then I went
through all the kids and assigned a title. I just couldn't figure out
the calulated field of
KidTitle: IIf( [SEX] = "M", "Mr", IIf( [SEX] = "F", "Miss", "" ) )
The help section didn't make it clear enough for me.
David
> RowSource (of a Report) can be either a Table, a Query or an SQL String. I
> rarely use Tables (some of my Tables have 1M+ Records) as RecordSources and
> use Queries or SQL Strings to select only Records that meet certain
> criteria. What I post is the criteria to select the required Records using
> Query (which translates to an SQL String in the end) or an SQL String as the
> RecordSource for the Report.
Van T. Dinh - 28 May 2005 04:59 GMT
Use the expression I posted in an empty Column of the Query Design grid.
If you open the Datasheet of the Query, this Column will show Mr or Miss
depending on the gender of the kid.
KidTitle is called a Caluculated Field since it is calculated / derived from
other values. In your Reports / Labels, you can use the Calculated Fields
just like other Fields.

Signature
HTH
Van T. Dinh
MVP (Access)
> I got the gender select thing to work on the roster, very cool. I
> couldn't figure out the label thing so I added another field for "Title"
[quoted text clipped - 4 lines]
> The help section didn't make it clear enough for me.
> David
David G - 30 May 2005 07:35 GMT
Perfect!! I would have never figured that out. Thank you very much.
David
> Use the expression I posted in an empty Column of the Query Design grid.
>
[quoted text clipped - 4 lines]
> other values. In your Reports / Labels, you can use the Calculated Fields
> just like other Fields.
David G - 30 May 2005 07:43 GMT
I'm curious why the expression uses "IIf" instead of just "If". Any
particular reason for IIF?
David
> Use the expression I posted in an empty Column of the Query Design grid.
>
[quoted text clipped - 4 lines]
> other values. In your Reports / Labels, you can use the Calculated Fields
> just like other Fields.
Van T. Dinh - 31 May 2005 23:59 GMT
If is a VBA construct / statement which can only be used in VBA.
IIf (Immediate-If) is an Access function (i.e. returning a value) which can
be used in Queries as well as VBA.
Most of these functions are covered in virtually every Access book.

Signature
HTH
Van T. Dinh
MVP (Access)
> I'm curious why the expression uses "IIf" instead of just "If". Any
> particular reason for IIF?
> David