Report expression

  • Thread starter Thread starter beth
  • Start date Start date
B

beth

Field MP contains 2 alpha characters (BM, BE, HM, or HE) representing a
mailing preference. I would like my report, which will become a renewal form,
to print (Business E-mail, Business Mail, etc).
Any suggestions?
 
Create a new table called tblMailingPreference.

Make a text field named MP and also make it the primary key.
Make another text field named MailingPreference.

Populate the new table with the appropriate data. Then link the new table to
the original by the MP fields in a query. Use the MailingPreference field to
show the words that you wish to see.
 
Field MP contains 2 alpha characters (BM, BE, HM, or HE) representing a
mailing preference. I would like my report, which will become a renewal form,
to print (Business E-mail, Business Mail, etc).
Any suggestions?

beth, you could try IIF statements. But I would advise creating a
seperate table:

CODE:
BM
BE
HM
HE

TYPE:
Business E-Mail
Business Mail
etc
etc

and setting the relationship as one to many. You can then include the
new table into your query and display the "translated" code on the
report.

Otherwise you could use IIF statements.
 
I'm under a little time contraint. Isn't there an expression like If [MP]=BE,
print "Business E-mail"?
 
Create a new table called tblMailingPreference.

Make a text field named MP and also make it the primary key.
Make another text field named MailingPreference.

Populate the new table with the appropriate data. Then link the new tableto
the original by the MP fields in a query. Use the MailingPreference fieldto
show the words that you wish to see.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.





- Show quoted text -

Thanks for backing me up Jerry, lol.
 
I'm still a rookie at If statements. Could you write one for me, then I could
follow the format?
 
You could write a complex, hard to maintain IIf statement. Below will get
you started.

IIf([MP] = "BM", "Business Mail", IIf([MP]="BE", "Business E-Mail",
"Unknown"))

However you'd be much better off doing things right the first time. If
you're in too much of a hurry to do it right now, will you have time to fix
it in the future?
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


beth said:
I'm under a little time contraint. Isn't there an expression like If [MP]=BE,
print "Business E-mail"?

Jerry Whittle said:
Create a new table called tblMailingPreference.

Make a text field named MP and also make it the primary key.
Make another text field named MailingPreference.

Populate the new table with the appropriate data. Then link the new table to
the original by the MP fields in a query. Use the MailingPreference field to
show the words that you wish to see.
 
Yes, I'll have time to alter b4 the year's end. My databse consists of tables
- base, home, business and then annual registrations. It might be easier b4
the membership expands to just go back and 'replace' BM w/ business mail,
etc.. I've been using access for 8 years now, but never to half of its
fullest.

Thanks for all of your help.

Jerry Whittle said:
You could write a complex, hard to maintain IIf statement. Below will get
you started.

IIf([MP] = "BM", "Business Mail", IIf([MP]="BE", "Business E-Mail",
"Unknown"))

However you'd be much better off doing things right the first time. If
you're in too much of a hurry to do it right now, will you have time to fix
it in the future?
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


beth said:
I'm under a little time contraint. Isn't there an expression like If [MP]=BE,
print "Business E-mail"?

Jerry Whittle said:
Create a new table called tblMailingPreference.

Make a text field named MP and also make it the primary key.
Make another text field named MailingPreference.

Populate the new table with the appropriate data. Then link the new table to
the original by the MP fields in a query. Use the MailingPreference field to
show the words that you wish to see.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


:

Field MP contains 2 alpha characters (BM, BE, HM, or HE) representing a
mailing preference. I would like my report, which will become a renewal form,
to print (Business E-mail, Business Mail, etc).
Any suggestions?
 
I respectfull disagree with Jerry on this one. Agreed it would be better to
use a translation table, but since that is not an option, there is a much
simple alternative to a complex (I really hate them) IIf statment.
It is the Swith function. You can use a calculated control on your report
to show a different value with it. If you need additional info, look it up
in VBA Help, but it would be like this:

=Switch([MP] = "BM", "Business Mail", [MP] = "BE", "Business E-Mail", [MP] =
"HM", "Home Mail", [MP] = "HE", "Home E-Mail")


beth said:
Yes, I'll have time to alter b4 the year's end. My databse consists of
tables
- base, home, business and then annual registrations. It might be easier
b4
the membership expands to just go back and 'replace' BM w/ business mail,
etc.. I've been using access for 8 years now, but never to half of its
fullest.

Thanks for all of your help.

Jerry Whittle said:
You could write a complex, hard to maintain IIf statement. Below will
get
you started.

IIf([MP] = "BM", "Business Mail", IIf([MP]="BE", "Business E-Mail",
"Unknown"))

However you'd be much better off doing things right the first time. If
you're in too much of a hurry to do it right now, will you have time to
fix
it in the future?
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


beth said:
I'm under a little time contraint. Isn't there an expression like If
[MP]=BE,
print "Business E-mail"?

:

Create a new table called tblMailingPreference.

Make a text field named MP and also make it the primary key.
Make another text field named MailingPreference.

Populate the new table with the appropriate data. Then link the new
table to
the original by the MP fields in a query. Use the MailingPreference
field to
show the words that you wish to see.
--
Jerry Whittle, Microsoft Access MVP
Light. Strong. Cheap. Pick two. Keith Bontrager - Bicycle Builder.


:

Field MP contains 2 alpha characters (BM, BE, HM, or HE)
representing a
mailing preference. I would like my report, which will become a
renewal form,
to print (Business E-mail, Business Mail, etc).
Any suggestions?
 

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

Back
Top