How do I selectively show information to make a label in Access

G

Guest

Microsoft Access 2003

I am trying to make a label in Microsoft Access. I have set up a query to
get the information that I want, but I only want to show part of the
information for 1 field on the label. For instance I have the date, the name
of the place and the type. So I set up a query to make labels for the most
current enteries into Access. I have 5 selections for type: green, yellow,
blue, red and orange (which I created as a drop down field list to select
from in the table created). I want to print labels for all new records, but
only want to include the type if it is orange. I don't want to include
green, yellow, blue or red on the label. I am not real familiar with macros
and don't know if I could create one to show only orange on the label.
 
T

Tim Ferguson

I want to print labels for all new records, but
only want to include the type if it is orange

Put this in the query designer[1]:

ColourScript: IIf(TypeColour = "Orange", "Orange", NULL)

and then connect the control on the report (label) to the ColourScript
column rather than the TypeColour.

Hope that helps


Tim F

[1] If you are not explicitly basing your reports on queries, you really
should do... :)
 
G

Guest

In the query design or query designer? Yes, I am taking the information
strictly from the query created.

Is ColourScript a new field that I will need to create?

Why type IIf(Typecolour="Orange", "Orange", Null)? Isn't null saying that
this won't show, when I want to show orange, but not the other colors?



Tim Ferguson said:
I want to print labels for all new records, but
only want to include the type if it is orange

Put this in the query designer[1]:

ColourScript: IIf(TypeColour = "Orange", "Orange", NULL)

and then connect the control on the report (label) to the ColourScript
column rather than the TypeColour.

Hope that helps


Tim F

[1] If you are not explicitly basing your reports on queries, you really
should do... :)
 
T

Tim Ferguson

Is ColourScript a new field that I will need to create?
Yes.


Why type IIf(Typecolour="Orange", "Orange", Null)? Isn't null saying
that this won't show, when I want to show orange, but not the other
colors?

If the colour is orange, then you get "orange"; otherwise you get Null.
Which was what was wanted, as far as I could tell.

HTH


Tim F
 
G

Guest

Where/How do I put this statement in the query design? There is no Control
Source when I click on the field in the query.
ColourScript: IIfTypecolour="Orange", "Orange", Null
 
T

Tim Ferguson

Where/How do I put this statement in the query design? There is no
Control Source when I click on the field in the query.
ColourScript: IIfTypecolour="Orange", "Orange", Null

Assuming you are using the query designer grid; you should have columns
with the top rows looking like ThingID, Texture, Flavour, etc for all the
fields you are taking from the table and using in the report. You might
have just one with a star(*) in it, but it's probably neater to add all
the fields you want explicitly.

In a new column, just enter the expression in the top row:-

ColourScript: IIf(Typecolour="Orange", "Orange", Null)


The bit before the colon :)) is the column name as it will appear in the
report's field list, and is what you enter as the controlsource for the
textbox where you want it to appear on the label. If you see what I mean.
The word TypeColour should of course refer to the actual fieldname you
have in your table that holds the "orange" etc values.


Hope that is clear

Tim F
 

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