Trouble with Fields

D

Dee

Hope this isn't too long. I'm using Word 2003

I'm pulling data from various spots in a data base. I've created the
formula to insert a comma in between each peice of data. My problem is, the
comma is being inserted after the of last piece of data even though there is
nothing after it.

This is difficult to explain without seeing the actual data base & document
but I'll try.....assume these people are Pilots of planes
Field Name Data
Name1 Susan
Name2 Bob
Name3 Pat
Name4 Tom

In a different place in the data base there are fields where we indicate
which person flies which planes. So on the Plane section of the data base
the user fills in as follows:

Plane#1 Screen: Pilots: 1 2 3 4 (field names are Pilot1; Pilot2,Pilot3,
Pilot4)
Plane#2 Screen: Pilots: 2 3 4
Plane#3 Screen: Pilots: 1 4

I want to pull the names from the fields that have data and separate them
with a comma. The names will be listed under each plane.

My formula looks like this:

{ IF "<PILOT1>" = "1""<NAME1>"""}{ IF "<PILOT1>" = "2""<NAME2>"""}{ IF
"<PILOT1>" = "3""<NAME3>"""}{ IF "<PILOT1>" = "4""<NAME4>"""}( IF "<PILOT1>"
<> " "","""} Then I repeat this formula for each Pilot - it's one big long
formula.

So the results look like this:

Under the first plane: Susan, Bob, Pat, Tom,
Under the second plane: Bob, Pat, Tom,
Under the thrid plane: Susan, Tom,

If there were no pilots entered there would show ,,,,

It works fine and inserts the comma in between each pilot until the last
pilot when a comma is inserted even though there is nothing after it. Can
anybody tell me what I'm doing wrong?

Thx
Dee
 
H

Henk57

This is typically a dBase issue, and my first hunch is to llok into y
dB application's reporting possibilities. Word isnt set up for thi
although it has some crude features. Quick and dirty, I would replac
the comma by a semicolon, so the last one is also a semicolon whic
isnt disturbing (a comma indeed suggests there is another one coming).
Is this acceptable?
 
D

Dee

The db application is a custom system that has word integrated into it. I
don't have the expertise to dig into how it all works. I'm really just at
the learning how to use fields and IF statements. THe basic ones don't seem
to difficult, but I have difficulty when I need to create something that
isn't the norm. I can't seem to find instructions anywhere that fit
'exactly' what I want to do.

Can you tell me if my statement looks correct? In other words, should it
work?

I'm pulling the data into a document that needs to look 'professional' so
the semicolon really won't work. I would want the last item that is pulled
to have nothing after it.

Thx,
Dee
 

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