Nested IF statement

M

Mr K

Hi,

I have a nested IF statement that works just fine.
It has however one clitch.
I can request up to 5 dates. If the first date is the
first date in the DB it doesn't wait for the next 4
inputs it just gives me the next 4 dates.
The problem is that the next 4 dates may not be the dates
I want. On each request I want to choose the 5 dates.

If I start with the second date of the DB or any other
date in the DB the sequence works fine.

Is there something I can do to stop this and have it work
as it does for all other dates.

Thank you,
Mr K
 
P

Peter Jamieson

Sorry, I couldn't really understand exactly what is happening here. Can you
post the field code of the IF statement (does it have ASK or FILLIN fields
in it, or are you just filling in the dates you want by hand, or what?) ,
and also tell us which version of Word and what the data source is.
 
C

Cindy M -WordMVP-

Hi Mr,

I'm having real problems envisioning what it is you're
trying to do. Can you give us some examples?
I have a nested IF statement that works just fine.
It has however one clitch.
I can request up to 5 dates. If the first date is the
first date in the DB it doesn't wait for the next 4
inputs it just gives me the next 4 dates.
The problem is that the next 4 dates may not be the dates
I want. On each request I want to choose the 5 dates.

If I start with the second date of the DB or any other
date in the DB the sequence works fine.

Is there something I can do to stop this and have it work
as it does for all other dates.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep
30 2003)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 
M

Mr K

Thank you for your inputs.

I'm run XP and Office XP.
My source is Excell.
I'm mail-merging using WORD.

The source looks like this:
Date Lecter Minister Server Greeter Gifts
Jan 4 2004 Joe Mary Tom Jack Murphy
Jan 11 2004 etc.
There are 52 weeks of data (all Sunday Dates)

The program Looks like this
If date = "Fill-in"(enter date 1)
Result 1
If date = "Fill-in"(enter date 2)
Result 2
If date = "Fill-in"(enter date 3)
Result 3
If date = "Fill-in"(enter date 4)
Result 4
If date = "Fill-in"(enter date 5)
Result 5
""
If I enter the first date in the DB (Jan 4 2004)in "enter
date 1" of the first "Fill-in" and click OK the program
goes off and gives me the data for that date and the next
4 sequensial dates.

If I enter any other date first, I'm asked for each
sequensial date.

Any questions?

Thanks again,

Mr K
 
G

Guest

The source looks like this:
Date Lecter Minister Server Greeter Gifts
Jan 4 2004 Joe Mary Tom Jack Murphy
Jan 11 2004 etc.
There are 52 weeks of data (all Sunday Dates)

The program Looks like this
An "IF" "Then" "Else" Statement!

If (Field Name)" " (Comparison)" " (Compared TO)" "
(Insert Text)
(Otherwise Insert this Text)
Field Name = "Date"
Comparison = "="
Compared To = "Fill-in"
Insert Text = "My text"
Otherwise Insert This Text = "Next IF statement"

There are 5 "If" statements each has the same format
except the last one. It's Otherwise.... ends in "".


This the first page of 5. Here it did not format
correctly but I think you can get the message.

Our Lady of the Assumption Catholic Church
Rev. Charles M. Hughes, Pastor
(912)564-2312
§§§
Mass Schedules


Monday:
Tuesday:

Wednesday 5:30 PM
Thursday:

Friday 10:00 AM
Saturday 5:00 PM
Sunday 9:00 AM

§§§
Feb 1 2004
§§§

Liturgy Schedule


Lector:
K. Brennan


Greeters / Ushers:
C. McCord
E. Mingle

Eucharistic Ministers:
B. Francis
P. Francis

Gift Bearers:
Brennan

Servers:
C. Cannon
T. Driggers

CCD Refreshments:
Kirkland



If you are unable to serve, please arrange for a
replacement
Thank you!
§§§
Church Notices:

If I enter Jan 4 2004 as the first "fill-in" the program
does not request the remaining entries. It does give the
5 weeks data. If I enter the second date or any other
date as the first "fill=in" date the remaining 4 "Fill-
in" requests are made. The result of this pass is
totally correct.

Hope this make the problem clearer.

Thank you for your time and patience.

Mr K
 
P

Peter Jamieson

OK, your description suggests that you have fields which look something like
this:

{ IF { MERGEFIELD Date } = { FILLIN }
"fields and text for the first week you want as per your example"
"{ IF { MERGEFIELD Date } = { FILLIN }
"fields and text for the second week you want as per your example"
"{ IF { MERGEFIELD Date } = { FILLIN }
"fields and text for the third week you want as per your example"
"" }" }" }

except that you have 5 rather than 3.

This is not really going to work because it is based on a misunderstanding
of how a mailmerge and the { MAILMERGE } fields are supposed to work. When
you open this document, in effect each { MERGEFIELD Date } will have the
same value. Typically it will be the value of the first date in your
spreadhseet, but it may be one of the later dates if you have changed the
record currently being previewed using the << and >> buttons (either in the
mail merge toolbar or the mail merge wizard). Let's assume for the moment it
is the first, i.e. Jan 4 2004.

So Word then executes the first FILLIN and you supply a date. If you enter
Jan 4 2004, the comparison will succeed and Word will simply insert

"fields and text for the first week you want as per your example"

It will not execute the other FILLIN fields because they would only be
executed if the comparison had failed.

If you enter a different date such as Jan 11 2004, the first comparison will
fail. So you should not see

"fields and text for the first week you want as per your example"

but you will see the next FILLIN. And so on. This isn't quite what you
describe but I think that is what is happening.

So what should you be doing? Well, of course it depends on a number of
things, not least what output you are trying to get and why you are storing
your data in the format you are using. But let's suppose that what you want
is to produce the data for the forthcoming few weeks. Then it would probably
be simpler just to leave out all the IF statements and FILLIN statements,
leave this lot

"fields and text for the first week you want as per your example"

in there, and use the "Edit recipient list" facility to select the 5 weeks
you need to produce data for, then perform the merge. That shoud be
reasonably straightforward but let us know if you do not understand what I'm
suggesting.

--
Peter Jamieson - Word MVP
Word MVP web site http://word.mvps.org/


The source looks like this:
Date Lecter Minister Server Greeter Gifts
Jan 4 2004 Joe Mary Tom Jack Murphy
Jan 11 2004 etc.
There are 52 weeks of data (all Sunday Dates)

The program Looks like this
An "IF" "Then" "Else" Statement!

If (Field Name)" " (Comparison)" " (Compared TO)" "
(Insert Text)
(Otherwise Insert this Text)
Field Name = "Date"
Comparison = "="
Compared To = "Fill-in"
Insert Text = "My text"
Otherwise Insert This Text = "Next IF statement"

There are 5 "If" statements each has the same format
except the last one. It's Otherwise.... ends in "".


This the first page of 5. Here it did not format
correctly but I think you can get the message.

Our Lady of the Assumption Catholic Church
Rev. Charles M. Hughes, Pastor
(912)564-2312
§§§
Mass Schedules


Monday:
Tuesday:

Wednesday 5:30 PM
Thursday:

Friday 10:00 AM
Saturday 5:00 PM
Sunday 9:00 AM

§§§
Feb 1 2004
§§§

Liturgy Schedule


Lector:
K. Brennan


Greeters / Ushers:
C. McCord
E. Mingle

Eucharistic Ministers:
B. Francis
P. Francis

Gift Bearers:
Brennan

Servers:
C. Cannon
T. Driggers

CCD Refreshments:
Kirkland



If you are unable to serve, please arrange for a
replacement
Thank you!
§§§
Church Notices:

If I enter Jan 4 2004 as the first "fill-in" the program
does not request the remaining entries. It does give the
5 weeks data. If I enter the second date or any other
date as the first "fill=in" date the remaining 4 "Fill-
in" requests are made. The result of this pass is
totally correct.

Hope this make the problem clearer.

Thank you for your time and patience.

Mr K
 
G

Guest

Hi,
I don't understand what your saying.

My Mail-merge program works. I can "fill-in" the first
date, "Fill-in" the second Date etc. for 5 dates click OK
and get 5 pages of "results". If I "fill-in" Jan 4 2004
as the first date the mail-merge doesn't ask for the
remaining 5 dates, the only problem and question is why
then and not any other time.

I'll send you the DB, the doc file and the result file if
you'd like.
..xls file is 21.5 Kb,
..doc file is 51.5 Kb,
Result file is 37.5 Kb

Then you can run it and see what I'm questioning?

Thank you for your time and patience,

Mr K
 
P

Peter Jamieson

I'll send you the DB, the doc file and the result file if
you'd like.
.xls file is 21.5 Kb,
.doc file is 51.5 Kb,
Result file is 37.5 Kb

It's not "if I'd like". I'd rather
a. you described your fields more precisely (I could only really guess based
on the information you provided, but I hope I showed you how you could
describe those fields more clearly)
b. you described what steps you were taking to perform the merge
c. you told us which version of Word you are using. 2000? 2002? 2003?
d. people didn't say "I don't understand what you said" without providing
any clues whatever about what it is they do not understand.
e. people did not assume that just because something seems to work most of
the time, it is a sound basis for creating something that works all of the
time.

You can despam my address and send me the stuff if /you/ like. But I still
need to know the answers to (b) and (c).

--
Peter Jamieson - Word MVP
Word MVP web site http://word.mvps.org/

Hi,
I don't understand what your saying.

My Mail-merge program works. I can "fill-in" the first
date, "Fill-in" the second Date etc. for 5 dates click OK
and get 5 pages of "results". If I "fill-in" Jan 4 2004
as the first date the mail-merge doesn't ask for the
remaining 5 dates, the only problem and question is why
then and not any other time.

I'll send you the DB, the doc file and the result file if
you'd like.
..xls file is 21.5 Kb,
..doc file is 51.5 Kb,
Result file is 37.5 Kb

Then you can run it and see what I'm questioning?

Thank you for your time and patience,

Mr K
 

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