A
Andy
Albert;
Please be so kind to offer Your assistance once more.
Your Word Merge code worked perfectly. I created a template in Word
inserting the fields in a table to print to labels, (7 Col., 4 Rows).
The fields were inserted into columns 1,3,5,7, (remainder of columns were
used as spacers.)
Noticed that one of the field names was too long for the column and Word
auto adjusted the row height. Wasn't happy with that so added an "Alias" to
the Qry used for the Form's Record Source,
(Example in the qry added: Short: OriginalLongName).
When I tried to "Modify the Template" Word opened and the "Header Record
Delimiters" dialog box opened with it asking for Field delimiter, ((Tab))
and Record delimiter ((enter)). The preview below that showed the original
field names. (Note: Below the field names it did show the correct data.)
Clicked the OK button in the dialog box. Word opened but without any menus
or tool bars. Nothing was displayed in the document. Clicked X to close
Word. It asked if want to save "Document1.doc, clicked No.
When Word closed Access displayed the Micorsoft Visual Basic diag box
showing: Run-Time error 5922 Word was unable to open the data source.
Clicked Debug.
'MsgBox strSaveDir
WordDoc.MailMerge.OpenDataSource _
Name:=strSaveDir & TextMerge, _
ConfirmConversions:=False, _
ReadOnly:=False, LinkToSource:=True, AddToRecentFiles:=False, _
PasswordDocument:="", PasswordTemplate:="",
WritePasswordDocument:="", _
WritePasswordTemplate:="", Revert:=False, Format:=0, _
Connection:="", SQLStatement:="", SQLStatement1:=""
Was highlighted in the WordCode module.
Note: 'MsgBox strSaveDir wasn't hightlighted included it so that You would
know where the error occurred.
After clicking on the "Reset" button couldn't return to the Database. The
form used to open the WordMerge was displayed but couldn't activate/use the
form or the database window.
Access didn't crash, was able to use the File menu to Exit Access.
After a few of the "non-crashes" discovered that if I clicked on the "Design
View" icon it would display "GuiWordTemplate :Form would display in design
view and could close it from there.
Tried adding a new template. Same errors. Same lock ups.
Believed that if the fields were re-named back to the original names it
would be able to edit the template or add a new one. Same errors. Same
lock ups.
Thought came to mind that perhaps the code in the "WordCode" module had been
modified. Copied and pasted it anew. Same errors. Same lock ups.
Deleted the C:\MyFolder\Word\Label.doc template. Same errors. Same lock
ups.
Opened the C:\MyFolder\Word\merge.888 in Word it showed the original field
names. At first Deleted all but one of the field names and data. Then
deleted everything in 888 and saved it. Same errors. Same lock ups.
Copied Your original merge.888 and finally deleted merge.888 and generated a
new one. Same errors. Same lock ups.
And before composing and posting this letter used Word to display
Header/Footers all were blank. Also tried using a new qry containing only
one of the original fields. Same errors. Same lock ups.
Albert; realize this post is lenghthy and whether You reply or not wanted to
inform You of this "Bug" and give You the details of what was already tried
to remove it. Your creation is crisp, clear and to the point. And as I
said before wish that Microsoft's help and knowledge bases were as easy.
Incidently the Code still works for all other qrys but not the original one.
And somewhere along the way also discovered that an alias in the qry used as
the Form's record source would not work, the alias had to be added to a
seperate qry and then that qry was used to feed the qry used as the record
source.
Thank You for Your Time.
Andy
Please be so kind to offer Your assistance once more.
Your Word Merge code worked perfectly. I created a template in Word
inserting the fields in a table to print to labels, (7 Col., 4 Rows).
The fields were inserted into columns 1,3,5,7, (remainder of columns were
used as spacers.)
Noticed that one of the field names was too long for the column and Word
auto adjusted the row height. Wasn't happy with that so added an "Alias" to
the Qry used for the Form's Record Source,
(Example in the qry added: Short: OriginalLongName).
When I tried to "Modify the Template" Word opened and the "Header Record
Delimiters" dialog box opened with it asking for Field delimiter, ((Tab))
and Record delimiter ((enter)). The preview below that showed the original
field names. (Note: Below the field names it did show the correct data.)
Clicked the OK button in the dialog box. Word opened but without any menus
or tool bars. Nothing was displayed in the document. Clicked X to close
Word. It asked if want to save "Document1.doc, clicked No.
When Word closed Access displayed the Micorsoft Visual Basic diag box
showing: Run-Time error 5922 Word was unable to open the data source.
Clicked Debug.
'MsgBox strSaveDir
WordDoc.MailMerge.OpenDataSource _
Name:=strSaveDir & TextMerge, _
ConfirmConversions:=False, _
ReadOnly:=False, LinkToSource:=True, AddToRecentFiles:=False, _
PasswordDocument:="", PasswordTemplate:="",
WritePasswordDocument:="", _
WritePasswordTemplate:="", Revert:=False, Format:=0, _
Connection:="", SQLStatement:="", SQLStatement1:=""
Was highlighted in the WordCode module.
Note: 'MsgBox strSaveDir wasn't hightlighted included it so that You would
know where the error occurred.
After clicking on the "Reset" button couldn't return to the Database. The
form used to open the WordMerge was displayed but couldn't activate/use the
form or the database window.
Access didn't crash, was able to use the File menu to Exit Access.
After a few of the "non-crashes" discovered that if I clicked on the "Design
View" icon it would display "GuiWordTemplate :Form would display in design
view and could close it from there.
Tried adding a new template. Same errors. Same lock ups.
Believed that if the fields were re-named back to the original names it
would be able to edit the template or add a new one. Same errors. Same
lock ups.
Thought came to mind that perhaps the code in the "WordCode" module had been
modified. Copied and pasted it anew. Same errors. Same lock ups.
Deleted the C:\MyFolder\Word\Label.doc template. Same errors. Same lock
ups.
Opened the C:\MyFolder\Word\merge.888 in Word it showed the original field
names. At first Deleted all but one of the field names and data. Then
deleted everything in 888 and saved it. Same errors. Same lock ups.
Copied Your original merge.888 and finally deleted merge.888 and generated a
new one. Same errors. Same lock ups.
And before composing and posting this letter used Word to display
Header/Footers all were blank. Also tried using a new qry containing only
one of the original fields. Same errors. Same lock ups.
Albert; realize this post is lenghthy and whether You reply or not wanted to
inform You of this "Bug" and give You the details of what was already tried
to remove it. Your creation is crisp, clear and to the point. And as I
said before wish that Microsoft's help and knowledge bases were as easy.
Incidently the Code still works for all other qrys but not the original one.
And somewhere along the way also discovered that an alias in the qry used as
the Form's record source would not work, the alias had to be added to a
seperate qry and then that qry was used to feed the qry used as the record
source.
Thank You for Your Time.
Andy