Silly fields harass me

C

consiglieri

Hi
I've done some posting lately and gotten good responses and I almost
have a workable template for my needs.. but I have suddenly been
stumped by a field. It looks like this

{DATABASE \c "DSN=database;" \s "SELECT Table1.Field1 FROM Table1,
Table2 WHERE Table2.Field1 = {FILLIN "Supply a nr"} AND Table1.Field1 =
Table2.Field2}

The whole things works with one small exception. If I switch fieldcodes
so only the results show and do an updat (F9) the whole view ends up in
the show field code mode .. now if I switch to not show field code mode
the result displays correctly. Why am I ending up in the display field
code mode when updating?
 
C

consiglieri

Hi

Never mind... my brain is beyond repair. I had view "fieldcodes" set in
my settings which ofocurse explains the whole thing. My apologies to
anyone who needlessly read this.
 
J

John McGhie [MVP - Word and Word Macintosh]

You have a runtime error that Word can't understand in one of the nested
fields :)

DON'T ask me which one :) But I think it's the DATABASE field: I don't
think Word will let you reference TWO tables.

Hi
I've done some posting lately and gotten good responses and I almost
have a workable template for my needs.. but I have suddenly been
stumped by a field. It looks like this

{DATABASE \c "DSN=database;" \s "SELECT Table1.Field1 FROM Table1,
Table2 WHERE Table2.Field1 = {FILLIN "Supply a nr"} AND Table1.Field1 =
Table2.Field2}

The whole things works with one small exception. If I switch fieldcodes
so only the results show and do an updat (F9) the whole view ends up in
the show field code mode .. now if I switch to not show field code mode
the result displays correctly. Why am I ending up in the display field
code mode when updating?

--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 (0) 4 1209 1410
 
C

consiglieri

Hi John

Thanks for the answer... I should have stated that the databse query is
done in Word97 and not on mac. The reference to two tables works fine.
Once I unchecked the box view fieldcodes in my setting my other problem
dissapeared.

I should mention I',m jumping back and forth from mac to windows which
is why I sometimes forget that this is a mac group :)
 
J

Jim Gordon MVP

Hi John & consiglieri,

You can have more than one table referenced within a single document. In
a different thread of yours look for an example.

When using the DATABASE field code you can specify formatting using a
combination of two additional field switches, the \l and the \b switches.

The \l switch is a number that refers to which formatting set will be
applied. Look in TABLE > AUTOFORMAT and count from the top of the list
down and use the corresponding number. The top one is 1, the next one is
2, etc. the field code will be \l "4" with the quotation marks to use
the formatting of the 4th autoformat from the top of the list.

The \b switch is a number that is calculated by adding up various
combinations of settings. When you are in Table > Autoformat dialog box
notice at the bottom of the dialog you can turn various formatting
attributes on and off. Each of those attributes is represented by a
number. You add up the various values and put the sum of those values
into the switch, such as \b "511". To see the numbers asssociated with
each value use the help system search. Enter the word Database and then
search. The first item will be the Database field codes. Click that to
see a table with the values.

-Jim
 
C

consiglieri

Hi

Thanks.. I had missed the ""whihc is why I wasnt getting any formatting
done.

Final question .... I have chosen autofit among other variables yet one
column doesnt resize to fit the text

Boink Boink

appears as
Boink
Boink

If I manually go in and set the kolumne to autofit the it resizes to
Boink Boink.

Since the size of the field varies I would like it to resize to fit the
text.. any thoughts on why autofit isnt doing that?
 
J

Jim Gordon MVP

Hi consiglieri,

Perhaps wider margins or switch to landscape in page setup? I don't
know why it should make any difference doing it manually or using the
field switch. I would expect the same routine to run.

-Jim
 
C

consiglieri

Hi Jim
From what I've gathered you need to format everything, i.e set the
correct format on the table as well as the fieldcodes. Simply inserting
MERGEFORMAT does not take care of the table formating .. but if I
manually resize the table columns to correct width the the MERGEFORMAT
makes sure that size is retained. Apparently there is an issue with
resizing cells on the return output from a mysql query.

Anyway I have solved my issues. The mac is served via an excel sheet
and the windows machines do it directly via MsWord. works real nice!
Now if Microsoft could just get odbc working in Word but alas I fear
that is many years away.

Anyway, HUGE thanks for your input Jim, and from everyone else who gave
me input. This is a very good list. I shall hang around and see if at
some time can help someone else.

Have a nice weekend!
 

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