Conditional Paragraph on Form Letter Report

R

RNUSZ@OKDPS

I have a need to check a field in the current record that is sent to a
specific FORM-LETTER report page. If the field LIC_STAT_CDE = S then I need
to print this special paragraph in a Text box on my form-letter
----------------------------------------------------------------------------------------------------------
=" It is hereby ordered, based upon evidence received at the above
hearing, that the license and registration(s) of " & [LIC_FIRST_NME]+" " &
[LIC_MIDDLE_NME]+" " & [LIC_LAST_NME] & IIf(IsNull([LIC_SUBT_TXT]),""," " &
[LIC_SUBT_TXT]) & ", is suspended immediately for operating or permitting the
operation of a motor vehicle without insurance or security pursuant to 47
o.s. §7-601. Said suspension shall continue until proof of curent insurance
in your name is filed with this Department along with a $100.00 reinstatement
fee in the form of a cashier's check or money order made payable to the
Department of Public Safety.
----------------------------------------------------------------------------------------------------------

if this same field LIC_STAT_CDE has a value of N. then print this in that
same paragraph position
----------------------------------------------------------------------------------------------------------
=" It is further ordered, based upon evidence received at the above
hearing, that the license and registration(s) of " & [LIC_FIRST_NME]+" " &
[LIC_MIDDLE_NME]+" " & [LIC_LAST_NME] & IIf(IsNull([LIC_SUBT_TXT]),""," " &
[LIC_SUBT_TXT]) & ", shall remain suspended unless proof of current insurance
in your name is filed with this Department along with a $100.000 reinstatment
fee in the form of a cashier's check or money order made payable to the
Department of Public Safety."

is there some way to code the conditional on output lik
--------------------------------------------------------------------------------------------------------
=(If LIC_STAT_CDE = S, then
=" It is hereby ordered, based upon evidence received at the above
hearing, that the license and registration(s) of " & [LIC_FIRST_NME]+" " &
[LIC_MIDDLE_NME]+" " & [LIC_LAST_NME] & IIf(IsNull([LIC_SUBT_TXT]),""," " &
[LIC_SUBT_TXT]) & ", is suspended immediately for operating or permitting the
operation of a motor vehicle without insurance or security pursuant to 47
o.s. §7-601. Said suspension shall continue until proof of curent insurance
in your name is filed with this Department along with a $100.00 reinstatement
fee in the form of a cashier's check or money order made payable to the
Department of Public Safety. " else =" It is further ordered, based upon
evidence received at the above hearing, that the license and registration(s)
of " & [LIC_FIRST_NME]+" " & [LIC_MIDDLE_NME]+" " & [LIC_LAST_NME] &
IIf(IsNull([LIC_SUBT_TXT]),""," " & [LIC_SUBT_TXT]) & ", shall remain
suspended unless proof of current insurance in your name is filed with this
Department along with a $100.000 reinstatment fee in the form of a cashier's
check or money order made payable to the Department of Public Safety."

--------------------------------------------------------------------------------------------------------

or do I need to create two separate form letters, one for each condition of
LIC_STAT_CDE?

Thanks in advance...
 
S

Steve Schapel

Robert,

=IIf([LIC_STAT_CDE]="S"," It is hereby ordered, based upon evidence
received at the above hearing, that the license and registration(s) of "
& [LIC_FIRST_NME]+" " & [LIC_MIDDLE_NME]+" " & [LIC_LAST_NME] & "
"+[LIC_SUBT_TXT] & ", is suspended immediately for operating or
permitting the operation of a motor vehicle without insurance or
security pursuant to 47 o.s. §7-601. Said suspension shall continue
until proof of curent insurance in your name is filed with this
Department along with a $100.00 reinstatement fee in the form of a
cashier's check or money order made payable to the Department of Public
Safety."," It is further ordered, based upon evidence received at
the above hearing, that the license and registration(s) of " &
[LIC_FIRST_NME]+" " & [LIC_MIDDLE_NME]+" " & [LIC_LAST_NME] & "
"+[LIC_SUBT_TXT] & ", shall remain suspended unless proof of current
insurance in your name is filed with this Department along with a
$100.000 reinstatment fee in the form of a cashier's check or money
order made payable to the Department of Public Safety.")

--
Steve Schapel, Microsoft Access MVP


RNUSZ@OKDPS said:
I have a need to check a field in the current record that is sent to a
specific FORM-LETTER report page. If the field LIC_STAT_CDE = S then I need
to print this special paragraph in a Text box on my form-letter:
----------------------------------------------------------------------------------------------------------
=" It is hereby ordered, based upon evidence received at the above
hearing, that the license and registration(s) of " & [LIC_FIRST_NME]+" " &
[LIC_MIDDLE_NME]+" " & [LIC_LAST_NME] & IIf(IsNull([LIC_SUBT_TXT]),""," " &
[LIC_SUBT_TXT]) & ", is suspended immediately for operating or permitting the
operation of a motor vehicle without insurance or security pursuant to 47
o.s. §7-601. Said suspension shall continue until proof of curent insurance
in your name is filed with this Department along with a $100.00 reinstatement
fee in the form of a cashier's check or money order made payable to the
Department of Public Safety."
----------------------------------------------------------------------------------------------------------

if this same field LIC_STAT_CDE has a value of N. then print this in that
same paragraph position.
----------------------------------------------------------------------------------------------------------
=" It is further ordered, based upon evidence received at the above
hearing, that the license and registration(s) of " & [LIC_FIRST_NME]+" " &
[LIC_MIDDLE_NME]+" " & [LIC_LAST_NME] & IIf(IsNull([LIC_SUBT_TXT]),""," " &
[LIC_SUBT_TXT]) & ", shall remain suspended unless proof of current insurance
in your name is filed with this Department along with a $100.000 reinstatment
fee in the form of a cashier's check or money order made payable to the
Department of Public Safety."

is there some way to code the conditional on output like
--------------------------------------------------------------------------------------------------------
=(If LIC_STAT_CDE = S, then
=" It is hereby ordered, based upon evidence received at the above
hearing, that the license and registration(s) of " & [LIC_FIRST_NME]+" " &
[LIC_MIDDLE_NME]+" " & [LIC_LAST_NME] & IIf(IsNull([LIC_SUBT_TXT]),""," " &
[LIC_SUBT_TXT]) & ", is suspended immediately for operating or permitting the
operation of a motor vehicle without insurance or security pursuant to 47
o.s. §7-601. Said suspension shall continue until proof of curent insurance
in your name is filed with this Department along with a $100.00 reinstatement
fee in the form of a cashier's check or money order made payable to the
Department of Public Safety. " else =" It is further ordered, based upon
evidence received at the above hearing, that the license and registration(s)
of " & [LIC_FIRST_NME]+" " & [LIC_MIDDLE_NME]+" " & [LIC_LAST_NME] &
IIf(IsNull([LIC_SUBT_TXT]),""," " & [LIC_SUBT_TXT]) & ", shall remain
suspended unless proof of current insurance in your name is filed with this
Department along with a $100.000 reinstatment fee in the form of a cashier's
check or money order made payable to the Department of Public Safety."

--------------------------------------------------------------------------------------------------------

or do I need to create two separate form letters, one for each condition of
LIC_STAT_CDE?

Thanks in advance...
 
R

RNUSZ@OKDPS

I think I understand what you are printing, but want to clarify something.
With the way you have this coded, to me it appears that on a conditional
code of LIC_STAT_CDE = "S", it prints both paragraphs.

What I need is on LIC_STAT_CDE = "S", it prints the first paragraph, on
LIC_STAT_CDE = "N" it would print only the 2nd paragraph. I'll attempt your
first response, and see if it works to my desire. Thanks for responding so
quickly, your assistance is very greatly appreciated.

RNUSZ@OKDPS said:
I have a need to check a field in the current record that is sent to a
specific FORM-LETTER report page. If the field LIC_STAT_CDE = S then I need
to print this special paragraph in a Text box on my form-letter:
----------------------------------------------------------------------------------------------------------
=" It is hereby ordered, based upon evidence received at the above
hearing, that the license and registration(s) of " & [LIC_FIRST_NME]+" " &
[LIC_MIDDLE_NME]+" " & [LIC_LAST_NME] & IIf(IsNull([LIC_SUBT_TXT]),""," " &
[LIC_SUBT_TXT]) & ", is suspended immediately for operating or permitting the
operation of a motor vehicle without insurance or security pursuant to 47
o.s. §7-601. Said suspension shall continue until proof of curent insurance
in your name is filed with this Department along with a $100.00 reinstatement
fee in the form of a cashier's check or money order made payable to the
Department of Public Safety."
----------------------------------------------------------------------------------------------------------

if this same field LIC_STAT_CDE has a value of N. then print this in that
same paragraph position.
----------------------------------------------------------------------------------------------------------
=" It is further ordered, based upon evidence received at the above
hearing, that the license and registration(s) of " & [LIC_FIRST_NME]+" " &
[LIC_MIDDLE_NME]+" " & [LIC_LAST_NME] & IIf(IsNull([LIC_SUBT_TXT]),""," " &
[LIC_SUBT_TXT]) & ", shall remain suspended unless proof of current insurance
in your name is filed with this Department along with a $100.000 reinstatment
fee in the form of a cashier's check or money order made payable to the
Department of Public Safety."

is there some way to code the conditional on output like
--------------------------------------------------------------------------------------------------------
=(If LIC_STAT_CDE = S, then
=" It is hereby ordered, based upon evidence received at the above
hearing, that the license and registration(s) of " & [LIC_FIRST_NME]+" " &
[LIC_MIDDLE_NME]+" " & [LIC_LAST_NME] & IIf(IsNull([LIC_SUBT_TXT]),""," " &
[LIC_SUBT_TXT]) & ", is suspended immediately for operating or permitting the
operation of a motor vehicle without insurance or security pursuant to 47
o.s. §7-601. Said suspension shall continue until proof of curent insurance
in your name is filed with this Department along with a $100.00 reinstatement
fee in the form of a cashier's check or money order made payable to the
Department of Public Safety. " else =" It is further ordered, based upon
evidence received at the above hearing, that the license and registration(s)
of " & [LIC_FIRST_NME]+" " & [LIC_MIDDLE_NME]+" " & [LIC_LAST_NME] &
IIf(IsNull([LIC_SUBT_TXT]),""," " & [LIC_SUBT_TXT]) & ", shall remain
suspended unless proof of current insurance in your name is filed with this
Department along with a $100.000 reinstatment fee in the form of a cashier's
check or money order made payable to the Department of Public Safety."

--------------------------------------------------------------------------------------------------------

or do I need to create two separate form letters, one for each condition of
LIC_STAT_CDE?

Thanks in advance...
 
S

Steve Schapel

Robert,

No, this is using an IIf() function, so the general idea is that the
first paragraph will be used if LIC_STAT_CDE = "S" and the second
paragraph if it is not "S".
 
R

RNUSZ@OKDPS

Steve,

Thanks for responding so quickly, your assistance is greatly appreciated.
I've included the code snippet that you provided, which does produce the
desired results, but there is one problem.... the code snippet used was:
=================================================
=IIf([LIC_STAT_CDE]="S"," It is hereby ordered, based upon evidence
received at the above hearing, that the license and registration(s) of " &
[LIC_FIRST_NME]+" " & [LIC_MIDDLE_NME]+" " & [LIC_LAST_NME] & "
"+[LIC_SUBT_TXT] & ", is suspended immediately for operating or permitting
the operation of a motor vehicle without insurance or security pursuant to 47
o.s. §7-601. Said suspension shall continue until proof of curent insurance
in your name is filed with this Department along with a $100.00 reinstatement
fee in the form of a cashier's check or money order made payable to the
Department of Public Safety."," It is further ordered, based upon evidence
received at the above hearing, that the license and registration(s) of " &
[LIC_FIRST_NME]+" " & [LIC_MIDDLE_NME]+" " & [LIC_LAST_NME] & "
"+[LIC_SUBT_TXT] & ", shall remain suspended unless proof of current
insurance in your name is filed with this Department along with a $100.000
reinstatment fee in the form of a cashier's check or money order made payable
to the Department of Public Safety.")
=================================================

This report is based on the results of a multi-table inner joined/left
joined complex query named FRQ-FOF. The field name LIC_STAT_CDE is one of
the results fields from this query. The problem lies when you open the
report that we've created that uses this code from our question/results, the
open function prompts the user to "enter parameter value " and names the
field " LIC_STAT_CDE ". I have tried using the following code:
===================================================
=IIf([FRQ-FOF].[LIC_STAT_CDE]="S"," It is hereby ordered, based upon
evidence received at the above hearing, that the license and registration(s)
of " & [LIC_FIRST_NME]+" " & [LIC_MIDDLE_NME]+" " & [LIC_LAST_NME] & "
"+[LIC_SUBT_TXT] & ", is suspended immediately for operating or permitting
the operation of a motor vehicle without insurance or security pursuant to 47
o.s. §7-601. Said suspension shall continue until proof of curent insurance
in your name is filed with this Department along with a $100.00 reinstatement
fee in the form of a cashier's check or money order made payable to the
Department of Public Safety."," It is further ordered, based upon evidence
received at the above hearing, that the license and registration(s) of " &
[LIC_FIRST_NME]+" " & [LIC_MIDDLE_NME]+" " & [LIC_LAST_NME] & "
"+[LIC_SUBT_TXT] & ", shall remain suspended unless proof of current
insurance in your name is filed with this Department along with a $100.000
reinstatment fee in the form of a cashier's check or money order made payable
to the Department of Public Safety.")
===============================================

But all the open function does is prompt the user to enter the paramater
value for FRQ-FOF .....

Are there any suggestions that would resolve the issue of parameter entry
request?

Thanks,
 
R

RNUSZ@OKDPS

Steve,

Please disregard my first reply for todays date, the one about prompting the
user for entry of the LIC_STAT_CDE. It was my mistake, as I had not included
this field in the results of the query. After double checking the query, and
found this field not included, I added it to the select results, and the code
as written in your first reply works like a charm....

Thanks for your assistance in resolving another stressful issue for the
newbies of Microsoft Access. I learn more about Access's capabilities, and
really do appreciate the assistance from this website as well..

Thanks again,
 

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