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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|