SetValue On Report

T

TH

I am creating a recipe database and I want to label a report based on which
search criteria are selected. For instance, if a person is printing an
alphabetical list I want the report labeled as such and if the person
selected recipes from a particular individual I want the report to say (for
instance) "Nancy's Recipes". In the report header, I have an unbound text
box followed by a label titled "Recipes". I have tried the SetValue action
in a macro and for some reason it is not working (for the expression I have
the word I want to label the report with enclosed in quotations). It tells
me that "You can't assign a value to this object". Any help would be
appreciated. Thanks.

Tonye
 
D

Duane Hookom

This depends on where the value is coming from. Are you prompting the user
to enter "Nancy's"? Where is "Nancy's" available for the report to grab?
 
W

Wayne Morgan

How are you selecting the search criteria? Is it from a form? If so, you can refer back to
that form (if it is still open) in the textbox to get the information you want. Also, it
would probably look better to concatenate the word "Recipes" right in the textbox instead
of placing a label after the textbox.

Example Control Source for the textbox:
=Forms!frmMyForm!cboMyCombobox & " Recipes"
 
T

TH

Duane, Wayne,

Thanks for answering. This is how I'm selecting the search criteria:
This is done using a swichboard to select how a person wants to sort the
recipes (alphabetical, by selected ingredients, by the name of the person
who the recipe is from etc). After selecting how the sorting is to be done
on the swichboard, the person can then narrow the search further (ie select
the name of the person whose recipes they want to view) and then click a
yes/no box to show which particular recipes are to be shown.

Right now I changed it to display the name of the first type of list
(alphabetical) when that option was selected (otherwise that label is
hidden). As I create the other forms I will have to address this question
again because the sorting will get more specific than just alphabetical (ie
a person will select "Nancy" from a drop down combo box to show all those
recipes and then click the yes/no box to select which of the recipes from
"Nancy" they want to show).

If I wanted to set the caption property of the label in the future, how
would I refer to that?

Thanks for your time and help.

Tonye
 
D

Duane Hookom

You can place text boxes on reports that have Control Source properties
like:
=Forms!frmSwitchBoard!cboAuthor & "'s Recipes"
 

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