A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Mailmerge
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Word/Access mailmerge



 
 
Thread Tools Display Modes
  #11  
Old April 18th, 2008, 10:14 PM posted to microsoft.public.word.mailmerge.fields
macropod
external usenet poster
 
Posts: 1,231
Default Word/Access mailmerge

Hi Frank,

You previously said "if Access field is blank (no DOB entered) then Word inserts the current date".
Now you say "Word displays 12:00:00 AM". That's entirely different and needs a different set of field coding!!!

If Word displays 12:00:00 AM, you need code like:
{IF{Mergefield Born} 0 {Mergefield Born \@ "d MMMM yyyy"}}

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

"Frank" wrote in message ...
Hi Graham - {Mergefield Born} or {Mergefield "Born"} both produce the same
result. If the date in the Access field 'Born' is 12/01/1991 then Word
displays 1/12/1991. If there is NO date in the field then Word displays
12:00:00 AM for every record.

There is no field in the database named 'Date', so when testing this against
a Word merge nothing happens.

Does this throw any light on the problem?

Cheers
Frank

Graham Mayor wrote:

What *exactly* does {Mergefield Born} alone produce when there is no data in
the field?
What *exactly* does {Date} alone produce?

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org



Frank wrote:
Macropod - thanks very much for responding. However, can't get your
suggestion to work.
Using: {IF{Mergefield Born}{DATE} {Mergefield Born \@ "d MMMM
yyyy"}} inserts the CURRENT date when mailmerged, UNLESS the Access
field 'Born' contains a date - in which case it merges and displays
correctly.
Where the Access field 'Born' is empty (no date of birth entered) I
just want to mailmerge a blank. To my simple mind - in the example
above - if I could enter 'NOTHING' in place of DATE, that would
produce what I want, but Access isn't that simple!!
Any further advice would be appreciated - I'm beginning to despair!
Frank


"macropod" wrote:

Hi Frank,

This sounds like Access is putting today's date in as the default.
Try this: .. make a copy of the existing DOB field and place it next
to the existing one, thus: «BirthDate» «BirthDate»
.. select both DOB fields and press Ctrl-F9 to wrap them in a new
field, thus: { «BirthDate» «BirthDate» }
.. position the cursor between the DOB fields and press Ctrl-F9 to
insert a new field, thus: { «BirthDate» { } «BirthDate» }
.. fill in/around the DOB fields, thus:
{IF«BirthDate»{DATE} «BirthDate» }.
.. add a date switch to ensure the DATE field is formatted the same
as your dates from Access are displayed, thus: {DATE \@ dd/MM/yyyy}
.. press F9 to update the display
.. run your mailmerge.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

"Frank" wrote in message
...
Word merges date of birth correctly where listed in Access records.
However, if Access field is blank (no DOB entered) then Word
inserts the current date. I just want a blank entry if Access field
holds no DOB.

Would be very grateful for help.
Frank





  #12  
Old April 18th, 2008, 10:28 PM posted to microsoft.public.word.mailmerge.fields
Frank
external usenet poster
 
Posts: 551
Default Word/Access mailmerge

Hi Macropod - I'm stumped!! {Mergefield Born \@ "d MMMM yyyy"} merges the
correct date of birth in Word where there is a DOB entered in the Access
field 'Born', but (tonight) produces 18 April 2008 where there is no DOB
entered.

Thanks for all your help - I will have another go tomorrow. Right now I
can't think!!

Cheers
Frank


"macropod" wrote:

Hi Frank,

It isn't Word that's inserting today's date - it's your database. For Word to display today's date, your Access field 'Born' cannot
be empty. And I'd be surprised if the date in Access is necessarily today's - I'd have expected the default date to be either the
date the record was last updated or the date the database was last saved. Either of those scenarios is beyond Word's ability to do
anything about unless there's a database field Word can test that says what the default date was for the record concerned.

However, since you're wedded to the idea that it's today's date (which could be the case if the db was last saved today or the
record was updated today), try coding the field as:
{IF{Mergefield Born \@ YYYYMMDD} {DATE \@ YYYYMMDD} {Mergefield Born \@ "d MMMM yyyy"}}
(and be careful with the spacing).

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

"Frank" wrote in message ...
Macropod - thanks very much for responding. However, can't get your
suggestion to work.
Using: {IF{Mergefield Born}{DATE} {Mergefield Born \@ "d MMMM yyyy"}}
inserts the CURRENT date when mailmerged, UNLESS the Access field 'Born'
contains a date - in which case it merges and displays correctly.
Where the Access field 'Born' is empty (no date of birth entered) I just
want to mailmerge a blank. To my simple mind - in the example above - if I
could enter 'NOTHING' in place of DATE, that would produce what I want, but
Access isn't that simple!!
Any further advice would be appreciated - I'm beginning to despair!
Frank


"macropod" wrote:

Hi Frank,

This sounds like Access is putting today's date in as the default. Try this:
.. make a copy of the existing DOB field and place it next to the existing one, thus:
«BirthDate» «BirthDate»
.. select both DOB fields and press Ctrl-F9 to wrap them in a new field, thus:
{ «BirthDate» «BirthDate» }
.. position the cursor between the DOB fields and press Ctrl-F9 to insert a new field, thus:
{ «BirthDate» { } «BirthDate» }
.. fill in/around the DOB fields, thus:
{IF«BirthDate»{DATE} «BirthDate» }.
.. add a date switch to ensure the DATE field is formatted the same as your dates from Access are displayed, thus:
{DATE \@ dd/MM/yyyy}
.. press F9 to update the display
.. run your mailmerge.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

"Frank" wrote in message ...
Word merges date of birth correctly where listed in Access records. However,
if Access field is blank (no DOB entered) then Word inserts the current date.
I just want a blank entry if Access field holds no DOB.

Would be very grateful for help.
Frank




  #13  
Old April 19th, 2008, 09:51 PM posted to microsoft.public.word.mailmerge.fields
Frank
external usenet poster
 
Posts: 551
Default Word/Access mailmerge

Macropod/Doug/Graham

Macropod - re. your last. Experimenting with field codes either inserted the
current date or 12.00.00 AM. Graham was asking what {Mergefield Born}
produced, and that was 'time' as opposed to 'current date'.

Doug - you suggested tracking back to the Access query, so I created a new
query using just the one field 'Born' and merged this to a new Word doc. Same
problem!

I then went back to the database and changed the data type of 'Born' from
date/time to text. Now the merge works perfectly using {Mergefield "Born" \@
"d MMMM yyyy"}
This change doesn't seem to have affected results produced by reports in
which I've used the 'Born' field to highlight those members above/below a
certain age. Comments on any such implications would be appreciated!

Finally, a huge thanks to all three for your interest and help. I am really
grateful.
Frank

Macropod wrote:
Hi Frank,

It isn't Word that's inserting today's date - it's your database. For Word to display today's date, your Access field 'Born' cannot
be empty. And I'd be surprised if the date in Access is necessarily today's - I'd have expected the default date to be either the
date the record was last updated or the date the database was last saved. Either of those scenarios is beyond Word's ability to do
anything about unless there's a database field Word can test that says what the default date was for the record concerned.

However, since you're wedded to the idea that it's today's date (which could be the case if the db was last saved today or the
record was updated today), try coding the field as:
{IF{Mergefield Born \@ YYYYMMDD} {DATE \@ YYYYMMDD} {Mergefield Born \@ "d MMMM yyyy"}}
(and be careful with the spacing).

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

"Frank" wrote in message ...
Macropod - thanks very much for responding. However, can't get your
suggestion to work.
Using: {IF{Mergefield Born}{DATE} {Mergefield Born \@ "d MMMM yyyy"}}
inserts the CURRENT date when mailmerged, UNLESS the Access field 'Born'
contains a date - in which case it merges and displays correctly.
Where the Access field 'Born' is empty (no date of birth entered) I just
want to mailmerge a blank. To my simple mind - in the example above - if I
could enter 'NOTHING' in place of DATE, that would produce what I want, but
Access isn't that simple!!
Any further advice would be appreciated - I'm beginning to despair!
Frank


"macropod" wrote:

Hi Frank,

This sounds like Access is putting today's date in as the default. Try this:
.. make a copy of the existing DOB field and place it next to the existing one, thus:
«BirthDate» «BirthDate»
.. select both DOB fields and press Ctrl-F9 to wrap them in a new field, thus:
{ «BirthDate» «BirthDate» }
.. position the cursor between the DOB fields and press Ctrl-F9 to insert a new field, thus:
{ «BirthDate» { } «BirthDate» }
.. fill in/around the DOB fields, thus:
{IF«BirthDate»{DATE} «BirthDate» }.
.. add a date switch to ensure the DATE field is formatted the same as your dates from Access are displayed, thus:
{DATE \@ dd/MM/yyyy}
.. press F9 to update the display
.. run your mailmerge.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

"Frank" wrote in message ...
Word merges date of birth correctly where listed in Access records. However,
if Access field is blank (no DOB entered) then Word inserts the current date.
I just want a blank entry if Access field holds no DOB.

Would be very grateful for help.
Frank




 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:51 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.