A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How to add conditional information



 
 
Thread Tools Display Modes
  #1  
Old August 10th, 2009, 05:25 PM posted to microsoft.public.access.reports
JamiLea
external usenet poster
 
Posts: 3
Default How to add conditional information

I am needing to know how I can add information to a report based on the state
the report is in. For example I am creating letters in an Access report and
if the letter is to be sent to CA then i need to enter this information: If
you feel you have been wrongfully denied reimbursement, you may contact the
California Department of Insurance at 300 South Spring Street, South Tower,
Suite 201, Los Angeles, CA 90013, in writing. The telephone number is: (800)
927-4357. If the letter is not CA then I do not need to add anything.
  #2  
Old August 10th, 2009, 05:39 PM posted to microsoft.public.access.reports
Al Campagna[_2_]
external usenet poster
 
Posts: 1,462
Default How to add conditional information

JamiLea,
Essentially... and there are several ways to do that...

Use the OnFormat event of the report section where this blurb prints.
If State = "CA" Then
CaliforniaBlurb.Visible = True
Else
CaliforniaBlurb.Visible = False
End
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."

"JamiLea" u53794@uwe wrote in message news:9a64ee7102ad1@uwe...
I am needing to know how I can add information to a report based on the
state
the report is in. For example I am creating letters in an Access report
and
if the letter is to be sent to CA then i need to enter this information:
If
you feel you have been wrongfully denied reimbursement, you may contact
the
California Department of Insurance at 300 South Spring Street, South
Tower,
Suite 201, Los Angeles, CA 90013, in writing. The telephone number is:
(800)
927-4357. If the letter is not CA then I do not need to add anything.



  #3  
Old August 10th, 2009, 06:43 PM posted to microsoft.public.access.reports
JamiLea via AccessMonster.com
external usenet poster
 
Posts: 3
Default How to add conditional information

I don't think I understand how to make this work. I tried doing this in the
but where i need the blurb to print and the state are in differenet sections.

Al Campagna wrote:
JamiLea,
Essentially... and there are several ways to do that...

Use the OnFormat event of the report section where this blurb prints.
If State = "CA" Then
CaliforniaBlurb.Visible = True
Else
CaliforniaBlurb.Visible = False
End
I am needing to know how I can add information to a report based on the
state

[quoted text clipped - 9 lines]
(800)
927-4357. If the letter is not CA then I do not need to add anything.


--
Message posted via http://www.accessmonster.com

  #4  
Old August 10th, 2009, 09:28 PM posted to microsoft.public.access.reports
fredg
external usenet poster
 
Posts: 4,386
Default How to add conditional information

On Mon, 10 Aug 2009 16:25:22 GMT, JamiLea wrote:

I am needing to know how I can add information to a report based on the state
the report is in. For example I am creating letters in an Access report and
if the letter is to be sent to CA then i need to enter this information: If
you feel you have been wrongfully denied reimbursement, you may contact the
California Department of Insurance at 300 South Spring Street, South Tower,
Suite 201, Los Angeles, CA 90013, in writing. The telephone number is: (800)
927-4357. If the letter is not CA then I do not need to add anything.


Here is one way.
Add a label control to the report where you wish to display that
information.
Set it's Caption property to:
If you feel you have been wrongfully ... etc. ... (800) 927-4357

Code the Format Event of the Section that contains the [State] field:
LableName.Visible = [State] = "CA"
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
  #5  
Old August 17th, 2009, 05:11 PM posted to microsoft.public.access.reports
JamiLea via AccessMonster.com
external usenet poster
 
Posts: 3
Default How to add conditional information

I tired that an the CA blurb is showing up on all of the letters even if the
property address is not in CA

fredg wrote:
I am needing to know how I can add information to a report based on the state
the report is in. For example I am creating letters in an Access report and

[quoted text clipped - 3 lines]
Suite 201, Los Angeles, CA 90013, in writing. The telephone number is: (800)
927-4357. If the letter is not CA then I do not need to add anything.


Here is one way.
Add a label control to the report where you wish to display that
information.
Set it's Caption property to:
If you feel you have been wrongfully ... etc. ... (800) 927-4357

Code the Format Event of the Section that contains the [State] field:
LableName.Visible = [State] = "CA"


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ports/200908/1

  #6  
Old August 17th, 2009, 05:40 PM posted to microsoft.public.access.reports
Al Campagna[_2_]
external usenet poster
 
Posts: 1,462
Default How to add conditional information

JamiLea,
Whenever you have a problem with code, and it doesn't work out,
"cut & paste exactly" the code you have, and where you placed that
code, in your reply.

Fred's code is correct, so...

Make sure you've put your code in the correct report section, and
that you've properly identified the label involved within that report
section,
and that the text control name State is also in this report section
(hidden or not), and that the value of State is really "CA".

Let's see the code nyo have...
--
hth
Al Campagna
Microsoft Access MVP
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."


"JamiLea via AccessMonster.com" u53794@uwe wrote in message
news:9abcf865c8e20@uwe...
I tired that an the CA blurb is showing up on all of the letters even if
the
property address is not in CA

fredg wrote:
I am needing to know how I can add information to a report based on the
state
the report is in. For example I am creating letters in an Access report
and

[quoted text clipped - 3 lines]
Suite 201, Los Angeles, CA 90013, in writing. The telephone number is:
(800)
927-4357. If the letter is not CA then I do not need to add anything.


Here is one way.
Add a label control to the report where you wish to display that
information.
Set it's Caption property to:
If you feel you have been wrongfully ... etc. ... (800) 927-4357

Code the Format Event of the Section that contains the [State] field:
LableName.Visible = [State] = "CA"


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ports/200908/1



  #7  
Old August 17th, 2009, 05:59 PM posted to microsoft.public.access.reports
fredg
external usenet poster
 
Posts: 4,386
Default How to add conditional information

On Mon, 17 Aug 2009 16:11:05 GMT, JamiLea via AccessMonster.com wrote:

I tired that an the CA blurb is showing up on all of the letters even if the
property address is not in CA

fredg wrote:
I am needing to know how I can add information to a report based on the state
the report is in. For example I am creating letters in an Access report and

[quoted text clipped - 3 lines]
Suite 201, Los Angeles, CA 90013, in writing. The telephone number is: (800)
927-4357. If the letter is not CA then I do not need to add anything.


Here is one way.
Add a label control to the report where you wish to display that
information.
Set it's Caption property to:
If you feel you have been wrongfully ... etc. ... (800) 927-4357

Code the Format Event of the Section that contains the [State] field:
LableName.Visible = [State] = "CA"



What is the "exact" code you wrote?
Does the [State] field return a text value "CA" or is it a look-up
field that actually contains a Number value?
Did you change [State] to whatever the actual control name on your
report is?

Here is an alternative method.
Add an unbound text control to the report (instead of the label).
Set it's control source to:
=IIf([State] = "CA","If you feel you have been wrongfully ... etc. ...
(800) 927-4357","")
No coding necessary if you use this method.
It is important that the field named [State] actually contains text,
i.e. "CA", or AZ" etc. and not a Lookup value.
If it is actually a lookup value then substitute the state's number
value (without quotes).

=IIf([State] = 8,"If you feel ...etc..)
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
  #8  
Old August 17th, 2009, 06:43 PM posted to microsoft.public.access.reports
JamiLea via AccessMonster.com
external usenet poster
 
Posts: 3
Default How to add conditional information

I got this expression to work =IIf([PState] = "CA","If you feel you have
been wrongfully ... etc. ...
(800) 927-4357",""). Thank you VERY much!!


fredg wrote:
I tired that an the CA blurb is showing up on all of the letters even if the
property address is not in CA

[quoted text clipped - 13 lines]
Code the Format Event of the Section that contains the [State] field:
LableName.Visible = [State] = "CA"


What is the "exact" code you wrote?
Does the [State] field return a text value "CA" or is it a look-up
field that actually contains a Number value?
Did you change [State] to whatever the actual control name on your
report is?

Here is an alternative method.
Add an unbound text control to the report (instead of the label).
Set it's control source to:
=IIf([State] = "CA","If you feel you have been wrongfully ... etc. ...
(800) 927-4357","")
No coding necessary if you use this method.
It is important that the field named [State] actually contains text,
i.e. "CA", or AZ" etc. and not a Lookup value.
If it is actually a lookup value then substitute the state's number
value (without quotes).

=IIf([State] = 8,"If you feel ...etc..)


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ports/200908/1

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:08 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.