N
Neil Marsh
Hi again. You folks were able to help me before, so I'll give it another shot. I hope I'm able to explain this clearly enough...
I'm writing a book about a radio series from the early 1980s and I've just finished collating all the data regarding each episode (title, writer, cast, crew, air dates, tape releases, etc.) in an Access 2k database that I built. I'm using merge fields in Work 2k to format the data neatly into the pages that will form the book's episode guide. I have almost all of the fields worked out so that lines for sub-headings where there is data will print and lines for sub-headings where there is no data will not. Switching from record to record under VIEW MERGED DATA looks very neat and clean, with the exception of one field, which I think will have to use a more complex formula involving IF...THEN...ELSE and COMPARE. Unfortunately, the only examples I have been able to find for COMPARE involve single text strings as the possible output and what I need to output are combined text strings and mergefields.
I'll try to illustrate the setup I have with a mocked-up entry:
THE TEST EPISODE FROM HELL #1
by Neil Marsh
Based on "The Possessed Broadcast" (1980), by Bill Howell & William Lane
Genre: Horror, Suspense, Mystery Length: 30:00
Produced at CBC Toronto Recorded on Mar 4, 80 & Mar 5, 80
Original Air Date: Jul 4, 80 Repeat(s): Feb 11, 81 & Aug 31, 82
The fields in blue (title, #, author, genre, length, produced at, recorded on, and original air date) always print because there will always be data for them, while the fields in red (based on and repeat) print only if there is data to put in them.
Now here is where I'm having a problem. The next two fields can end up in one of four possible combinations:
1. DATA - DATA
2. DATA - NODATA
3. NODATA -DATA
4. NODATA - NODATA
And the results would appear like this on the printed page, respectively:
1. FM Repeat: Dec 15, 80 Arts Nat'l Air Date: Apr 12, 84
2. FM Repeat: Dec 15, 80
3. Arts Nat'l Air Date: Apr 12, 84
4.
In other words, the layout of this line is dependent upon the content of the fields in the database. So, in order to keep the data all on the same line (yes, I know I could do this on separate lines and save myself the headache, but space is at a premium, so I need to condense as much as I can), I created a series of IF...THEN...ELSE COMPARE formulae:
v--This one checks to see if both fields are TRUE (the original Access fields are YES/NO checkboxes returning either TRUE or FALSE):
{ IF { = AND ( {COMPARE { MERGEFIELD FMRepeat } = TRUE }, { COMPARE { MERGEFIELD ArtsNatl } = TRUE ) } = 1 "FM Repeat: { MERGEFIELD CBCFMRepeat \@ "MMM d, yy" } Arts Nat'l Air Date: { MERGEFIELD ANAirDate \@ "MMM d, yy" }" }
If both fields are TRUE, then both text label/mergefield combinations should appear on the line:
FM Repeat: Dec 15, 80 Arts Nat'l Air Date: Apr 12, 84
------------
v--This one checks to see if the first field is TRUE and the second one FALSE:
{ IF { = AND ( {COMPARE { MERGEFIELD FMRepeat } = TRUE }, { COMPARE { MERGEFIELD ArtsNatl } = FALSE ) } = 1 "FM Repeat: { MERGEFIELD CBCFMRepeat \@ "MMM d, yy" }
If the first field is TRUE and the second one FALSE, then this is how the data should appear on the line:
FM Repeat: Dec 15, 80
------------
v--This one checks to see if the first field is FALSE and the second one TRUE:
{ IF { = AND ( {COMPARE { MERGEFIELD FMRepeat } = FALSE }, { COMPARE { MERGEFIELD ArtsNatl } = TRUE ) } = 1 "Arts Nat'l Air Date: { MERGEFIELD ANAirDate \@ "MMM d, yy" }
If the first field is FALSE and the second one TRUE, then this is how the data should appear on the line:
Arts Nat'l Air Date: Apr 12, 84
------------
v--And lastly, this one checks to see if both fields are FALSE:
{ IF { = AND ( {COMPARE { MERGEFIELD FMRepeat } = FALSE }, { COMPARE { MERGEFIELD ArtsNatl } = FALSE ) } = 1 "" }
If both fields are FALSE, then there should be nothing: no text and no new line.
------------
However, I am not getting the results I want. These combinations return *nothing* on any of the records I've created to test them: no label text, no mergefield data, nada. Completely blank lines. I'm quite sure there's a simple explanation (isn't there always?), but I'm not seeing it yet.
** Yes, I used ALT-F9 to create the brackets **
Can anyone at least give me a nudge in the right direction?
Thanks!
-/\/eil
---
Neil Marsh * (e-mail address removed)
Cambridge, MA * http://AudioBoy.net
**********************************************************************
"In the dream you are falling, lost in the listening distance as
dark locks in ... Nightfall!"
-- Opening narrative to "Nightfall"
CBC Radio horror anthology, 1980-1983
**********************************************************************
I'm writing a book about a radio series from the early 1980s and I've just finished collating all the data regarding each episode (title, writer, cast, crew, air dates, tape releases, etc.) in an Access 2k database that I built. I'm using merge fields in Work 2k to format the data neatly into the pages that will form the book's episode guide. I have almost all of the fields worked out so that lines for sub-headings where there is data will print and lines for sub-headings where there is no data will not. Switching from record to record under VIEW MERGED DATA looks very neat and clean, with the exception of one field, which I think will have to use a more complex formula involving IF...THEN...ELSE and COMPARE. Unfortunately, the only examples I have been able to find for COMPARE involve single text strings as the possible output and what I need to output are combined text strings and mergefields.
I'll try to illustrate the setup I have with a mocked-up entry:
THE TEST EPISODE FROM HELL #1
by Neil Marsh
Based on "The Possessed Broadcast" (1980), by Bill Howell & William Lane
Genre: Horror, Suspense, Mystery Length: 30:00
Produced at CBC Toronto Recorded on Mar 4, 80 & Mar 5, 80
Original Air Date: Jul 4, 80 Repeat(s): Feb 11, 81 & Aug 31, 82
The fields in blue (title, #, author, genre, length, produced at, recorded on, and original air date) always print because there will always be data for them, while the fields in red (based on and repeat
Now here is where I'm having a problem. The next two fields can end up in one of four possible combinations:
1. DATA - DATA
2. DATA - NODATA
3. NODATA -DATA
4. NODATA - NODATA
And the results would appear like this on the printed page, respectively:
1. FM Repeat: Dec 15, 80 Arts Nat'l Air Date: Apr 12, 84
2. FM Repeat: Dec 15, 80
3. Arts Nat'l Air Date: Apr 12, 84
4.
In other words, the layout of this line is dependent upon the content of the fields in the database. So, in order to keep the data all on the same line (yes, I know I could do this on separate lines and save myself the headache, but space is at a premium, so I need to condense as much as I can), I created a series of IF...THEN...ELSE COMPARE formulae:
v--This one checks to see if both fields are TRUE (the original Access fields are YES/NO checkboxes returning either TRUE or FALSE):
{ IF { = AND ( {COMPARE { MERGEFIELD FMRepeat } = TRUE }, { COMPARE { MERGEFIELD ArtsNatl } = TRUE ) } = 1 "FM Repeat: { MERGEFIELD CBCFMRepeat \@ "MMM d, yy" } Arts Nat'l Air Date: { MERGEFIELD ANAirDate \@ "MMM d, yy" }" }
If both fields are TRUE, then both text label/mergefield combinations should appear on the line:
FM Repeat: Dec 15, 80 Arts Nat'l Air Date: Apr 12, 84
------------
v--This one checks to see if the first field is TRUE and the second one FALSE:
{ IF { = AND ( {COMPARE { MERGEFIELD FMRepeat } = TRUE }, { COMPARE { MERGEFIELD ArtsNatl } = FALSE ) } = 1 "FM Repeat: { MERGEFIELD CBCFMRepeat \@ "MMM d, yy" }
If the first field is TRUE and the second one FALSE, then this is how the data should appear on the line:
FM Repeat: Dec 15, 80
------------
v--This one checks to see if the first field is FALSE and the second one TRUE:
{ IF { = AND ( {COMPARE { MERGEFIELD FMRepeat } = FALSE }, { COMPARE { MERGEFIELD ArtsNatl } = TRUE ) } = 1 "Arts Nat'l Air Date: { MERGEFIELD ANAirDate \@ "MMM d, yy" }
If the first field is FALSE and the second one TRUE, then this is how the data should appear on the line:
Arts Nat'l Air Date: Apr 12, 84
------------
v--And lastly, this one checks to see if both fields are FALSE:
{ IF { = AND ( {COMPARE { MERGEFIELD FMRepeat } = FALSE }, { COMPARE { MERGEFIELD ArtsNatl } = FALSE ) } = 1 "" }
If both fields are FALSE, then there should be nothing: no text and no new line.
------------
However, I am not getting the results I want. These combinations return *nothing* on any of the records I've created to test them: no label text, no mergefield data, nada. Completely blank lines. I'm quite sure there's a simple explanation (isn't there always?), but I'm not seeing it yet.
** Yes, I used ALT-F9 to create the brackets **
Can anyone at least give me a nudge in the right direction?
Thanks!
-/\/eil
---
Neil Marsh * (e-mail address removed)
Cambridge, MA * http://AudioBoy.net
**********************************************************************
"In the dream you are falling, lost in the listening distance as
dark locks in ... Nightfall!"
-- Opening narrative to "Nightfall"
CBC Radio horror anthology, 1980-1983
**********************************************************************