By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,685 Members | 1,896 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,685 IT Pros & Developers. It's quick & easy.

Reports and If()

P: n/a
Ok, this is my dilemna

I am writing a database in which I have. amongst many other things,
two fields one called odour and the other odourpersistance, on the
form both of there are a drop down box with a list along the lines of
"Not Detectable" "faint odour" etc each with a number defined,
Persistence is also a drop down box with "transient" and "persistent"
in it.

Ok, the reason why these are numbers in the database when they are
selected from the drop down box like this is because i have a third
field in my report which is Odourglobal, basically
[odour]*[odourpersistance].....

Ive done this fine however ofcourse in my report Odour and Odour
persistance are numbers, Odour global should be a number but i need to
change Odour and Odour persistance back into the worded descriptions
such as "Faint Odour..."

I thought of doing this with an If function ie

If([Odour] = 1) Then
"Not Detectable"
Elseif([Odour] = 2) Then
"Faint Odour"
....
Endif

However i have no idea were to put this If function on the text box
and whether or not this is the right way about doing what i want to
do.

Thx in Adv.

Darryl Neale
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
You should be able to do this with a calculated control using nested IIFs or
Choose.

Example Control Source:
=Choose([odour], "Not Detectable", "Faint Odour")

--
Wayne Morgan
Microsoft Access MVP
"Darryl Neale" <da****@allaboutgames.co.uk> wrote in message
news:bb**************************@posting.google.c om...
Ok, this is my dilemna

I am writing a database in which I have. amongst many other things,
two fields one called odour and the other odourpersistance, on the
form both of there are a drop down box with a list along the lines of
"Not Detectable" "faint odour" etc each with a number defined,
Persistence is also a drop down box with "transient" and "persistent"
in it.

Ok, the reason why these are numbers in the database when they are
selected from the drop down box like this is because i have a third
field in my report which is Odourglobal, basically
[odour]*[odourpersistance].....

Ive done this fine however ofcourse in my report Odour and Odour
persistance are numbers, Odour global should be a number but i need to
change Odour and Odour persistance back into the worded descriptions
such as "Faint Odour..."

I thought of doing this with an If function ie

If([Odour] = 1) Then
"Not Detectable"
Elseif([Odour] = 2) Then
"Faint Odour"
...
Endif

However i have no idea were to put this If function on the text box
and whether or not this is the right way about doing what i want to
do.

Thx in Adv.

Darryl Neale

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.