By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,786 Members | 2,241 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,786 IT Pros & Developers. It's quick & easy.

Endless output using OUTPUTTO MsWord

P: n/a
Mal
Hi,

I have a button on a form that outputs a report to word.
While it has been working well for a while, today it is not.

The behaviour now is that it endlessly outputs pages to word. There
are just 63 records (report pages) to output....I hit cancel when the
counter was in the 10'000 range.

Here is my code....any ideas??

Private Sub btnSend2Word_Click()
On Error GoTo Err_btnSend2Word_Click

Dim stDocName As String
stDocName = "rptMailSorted"

DoCmd.OutputTo acOutputReport, stDocName, acFormatRTF, "C:\My
Documents\CamperMail.doc", True
MsgBox "File Created."
DoCmd.Close acForm, Me.Name
DoCmd.Close acForm, "frmMain"
DoCmd.OpenForm "frmMain"
Exit_btnSend2Word_Click:
Exit Sub

Err_btnSend2Word_Click:
MsgBox Err.Description
Resume Exit_btnSend2Word_Click
End Sub
Nov 13 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
"Mal" <ma******@hotmail.com> wrote in message
news:75**************************@posting.google.c om...
Hi,

I have a button on a form that outputs a report to word.
While it has been working well for a while, today it is not.

The behaviour now is that it endlessly outputs pages to word. There
are just 63 records (report pages) to output....I hit cancel when the
counter was in the 10'000 range.

Here is my code....any ideas??

Private Sub btnSend2Word_Click()
On Error GoTo Err_btnSend2Word_Click

Dim stDocName As String
stDocName = "rptMailSorted"

DoCmd.OutputTo acOutputReport, stDocName, acFormatRTF, "C:\My
Documents\CamperMail.doc", True
MsgBox "File Created."
DoCmd.Close acForm, Me.Name
DoCmd.Close acForm, "frmMain"
DoCmd.OpenForm "frmMain"
Exit_btnSend2Word_Click:
Exit Sub

Err_btnSend2Word_Click:
MsgBox Err.Description
Resume Exit_btnSend2Word_Click
End Sub

Mel,
Sounds as though your report contains some code which is in a while loop
which is never ending - an infinite loop.
Is there any code behind the report? Does the report behave when you open it
from Access instead of shipping it to Word?

Cheers,
Doug

--
Remove the blots from my address to reply
Nov 13 '05 #2

P: n/a
Mal
Doug,

Thanks for your help. Here I was assuming that the problem was with
the export.

I have no code behind the report except for a NODATA and
ONCLOSE...both work fine.
The problem is with a certain record.
I have several fields (listed below) but I am thinking that the
problem is probably with the Message field (memo type).
For the problem record this field LEN is 3872. Does this exceed some
limit??
Or should I be searching within that field for some bad character??

Should I create an "overflow" field that I can dump the extra into and
then just format the report to have it all read together? or is there
a better approach??.

As it stand I go through this process.
1. download the raw (.txt) file (comma delim)
2. Clean it up...involves replacing the instaces of (a small box
character) with a (chr$(13)+chr$(10))...the text file doesn't hold the
enter characters.
3. Open the report for printing or exporting to Word.

Thanks again,
Mal.

Table fields are....
dteDate - date field - Posting Date
dteTime - time field - Posting Date
txtFrom - Text field
txtTo - Text Field
cmboSite - Text Field
PreppedForPrint - Yes/No
Printed - yes/no
tblCamperMailID - Autonumber
"Doug Hutcheson" <do*****************@nrm.blot.qld.blot.gov.blot.au > wrote in message news:<IU****************@news.optus.net.au>...
"Mal" <ma******@hotmail.com> wrote in message
news:75**************************@posting.google.c om...
Hi,

I have a button on a form that outputs a report to word.
While it has been working well for a while, today it is not.

The behaviour now is that it endlessly outputs pages to word. There
are just 63 records (report pages) to output....I hit cancel when the
counter was in the 10'000 range.

Here is my code....any ideas??

Private Sub btnSend2Word_Click()
On Error GoTo Err_btnSend2Word_Click

Dim stDocName As String
stDocName = "rptMailSorted"

DoCmd.OutputTo acOutputReport, stDocName, acFormatRTF, "C:\My
Documents\CamperMail.doc", True
MsgBox "File Created."
DoCmd.Close acForm, Me.Name
DoCmd.Close acForm, "frmMain"
DoCmd.OpenForm "frmMain"
Exit_btnSend2Word_Click:
Exit Sub

Err_btnSend2Word_Click:
MsgBox Err.Description
Resume Exit_btnSend2Word_Click
End Sub

Mel,
Sounds as though your report contains some code which is in a while loop
which is never ending - an infinite loop.
Is there any code behind the report? Does the report behave when you open it
from Access instead of shipping it to Word?

Cheers,
Doug

Nov 13 '05 #3

P: n/a
(Top post fixed - see below...)
"Doug Hutcheson" <do*****************@nrm.blot.qld.blot.gov.blot.au > wrote in message news:<IU****************@news.optus.net.au>...
"Mal" <ma******@hotmail.com> wrote in message
news:75**************************@posting.google.c om...
Hi,

I have a button on a form that outputs a report to word.
While it has been working well for a while, today it is not.

The behaviour now is that it endlessly outputs pages to word. There
are just 63 records (report pages) to output....I hit cancel when the
counter was in the 10'000 range.

Here is my code....any ideas??

Private Sub btnSend2Word_Click()
On Error GoTo Err_btnSend2Word_Click

Dim stDocName As String
stDocName = "rptMailSorted"

DoCmd.OutputTo acOutputReport, stDocName, acFormatRTF, "C:\My
Documents\CamperMail.doc", True
MsgBox "File Created."
DoCmd.Close acForm, Me.Name
DoCmd.Close acForm, "frmMain"
DoCmd.OpenForm "frmMain"
Exit_btnSend2Word_Click:
Exit Sub

Err_btnSend2Word_Click:
MsgBox Err.Description
Resume Exit_btnSend2Word_Click
End Sub

Mel,
Sounds as though your report contains some code which is in a while loop
which is never ending - an infinite loop.
Is there any code behind the report? Does the report behave when you open it from Access instead of shipping it to Word?

Cheers,
Doug

"Mal" <ma******@hotmail.com> wrote in message
news:75**************************@posting.google.c om... Doug,

Thanks for your help. Here I was assuming that the problem was with
the export.

I have no code behind the report except for a NODATA and
ONCLOSE...both work fine.
The problem is with a certain record.
I have several fields (listed below) but I am thinking that the
problem is probably with the Message field (memo type).
For the problem record this field LEN is 3872. Does this exceed some
limit??
Or should I be searching within that field for some bad character??

Should I create an "overflow" field that I can dump the extra into and
then just format the report to have it all read together? or is there
a better approach??.

As it stand I go through this process.
1. download the raw (.txt) file (comma delim)
2. Clean it up...involves replacing the instaces of (a small box
character) with a (chr$(13)+chr$(10))...the text file doesn't hold the
enter characters.
3. Open the report for printing or exporting to Word.

Thanks again,
Mal.

Table fields are....
dteDate - date field - Posting Date
dteTime - time field - Posting Date
txtFrom - Text field
txtTo - Text Field
cmboSite - Text Field
PreppedForPrint - Yes/No
Printed - yes/no
tblCamperMailID - Autonumber

Mal,
Hmmm...memo fields can sometimes be an issue, but I have not seen this
particular behaviour before.

What happens when you run the report directly from Access, instead of piping
it to Word? Does it go haywire there as well?

If you suspect the one record, try modifying your recordsource to be a query
which selects only that record and see if the problem persists. If so, you
may have a dicey record in the table. Usual practice with an data corruption
issue would be to perform a Repair on the database, but something in my
waters tells me there was a question over whether this was regarded as a
Good Thing (tm) for solving problems with memo fields. If you really do
narrow it down to a problem with that field, I would suggest you wait for a
more informative answer from one of the other experienced people in this
ng - I would hate to tell you to do something which only made things worse !

Would one of my esteemed peers in the group care to jump in here and shed
light on the pros and cons of attempting to solve problems with memo fields
by performing Repair?

Kind regards,
Doug
--
Remove the blots from my address to reply
Nov 13 '05 #4

P: n/a

"Doug Hutcheson" <do*****************@nrm.blot.qld.blot.gov.blot.au > wrote
in message news:mx****************@news.optus.net.au...
(Top post fixed - see below...)
"Doug Hutcheson" <do*****************@nrm.blot.qld.blot.gov.blot.au > wrote
in message news:<IU****************@news.optus.net.au>... "Mal" <ma******@hotmail.com> wrote in message
news:75**************************@posting.google.c om...
> Hi,
>
> I have a button on a form that outputs a report to word.
> While it has been working well for a while, today it is not.
>
> The behaviour now is that it endlessly outputs pages to word. There
> are just 63 records (report pages) to output....I hit cancel when the > counter was in the 10'000 range.
>
> Here is my code....any ideas??
>
> Private Sub btnSend2Word_Click()
> On Error GoTo Err_btnSend2Word_Click
>
> Dim stDocName As String
> stDocName = "rptMailSorted"
>
> DoCmd.OutputTo acOutputReport, stDocName, acFormatRTF, "C:\My
> Documents\CamperMail.doc", True
> MsgBox "File Created."
> DoCmd.Close acForm, Me.Name
> DoCmd.Close acForm, "frmMain"
> DoCmd.OpenForm "frmMain"
> Exit_btnSend2Word_Click:
> Exit Sub
>
> Err_btnSend2Word_Click:
> MsgBox Err.Description
> Resume Exit_btnSend2Word_Click
>
>
> End Sub
Mel,
Sounds as though your report contains some code which is in a while loop which is never ending - an infinite loop.
Is there any code behind the report? Does the report behave when you open it from Access instead of shipping it to Word?

Cheers,
Doug
"Mal" <ma******@hotmail.com> wrote in message
news:75**************************@posting.google.c om...
Doug,

Thanks for your help. Here I was assuming that the problem was with
the export.

I have no code behind the report except for a NODATA and
ONCLOSE...both work fine.
The problem is with a certain record.
I have several fields (listed below) but I am thinking that the
problem is probably with the Message field (memo type).
For the problem record this field LEN is 3872. Does this exceed some
limit??
Or should I be searching within that field for some bad character??

Should I create an "overflow" field that I can dump the extra into and
then just format the report to have it all read together? or is there
a better approach??.

As it stand I go through this process.
1. download the raw (.txt) file (comma delim)
2. Clean it up...involves replacing the instaces of (a small box
character) with a (chr$(13)+chr$(10))...the text file doesn't hold the
enter characters.
3. Open the report for printing or exporting to Word.

Thanks again,
Mal.

Table fields are....
dteDate - date field - Posting Date
dteTime - time field - Posting Date
txtFrom - Text field
txtTo - Text Field
cmboSite - Text Field
PreppedForPrint - Yes/No
Printed - yes/no
tblCamperMailID - Autonumber

Mal,
Hmmm...memo fields can sometimes be an issue, but I have not seen this
particular behaviour before.

What happens when you run the report directly from Access, instead of

piping it to Word? Does it go haywire there as well?

If you suspect the one record, try modifying your recordsource to be a query which selects only that record and see if the problem persists. If so, you
may have a dicey record in the table. Usual practice with an data corruption issue would be to perform a Repair on the database, but something in my
waters tells me there was a question over whether this was regarded as a
Good Thing (tm) for solving problems with memo fields. If you really do
narrow it down to a problem with that field, I would suggest you wait for a more informative answer from one of the other experienced people in this
ng - I would hate to tell you to do something which only made things worse !
Would one of my esteemed peers in the group care to jump in here and shed
light on the pros and cons of attempting to solve problems with memo fields by performing Repair?

Kind regards,
Doug
--
Remove the blots from my address to reply


Sorry abou the top post...

When the report is opened in Access it gets the smae haywire behaviour.
I identified 1 record that causes it. When it is filtered out the report
runs fine.
When it is the only record....it's still going haywire.....stranger and
stranger

Mal.
Nov 13 '05 #5

P: n/a
>
When the report is opened in Access it gets the smae haywire behaviour.
I identified 1 record that causes it. When it is filtered out the report
runs fine.
When it is the only record....it's still going haywire.....stranger and
stranger

Mal.

Sounds like a corrupt record. Try exporting the record to text,
deleting the record from the database and reimporting it from the text
file.
Nov 13 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.