473,395 Members | 1,442 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Endless output using OUTPUTTO MsWord

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
5 1613
"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
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
(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

"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
>
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Mark C | last post by:
All, I have exhaustingly been looking through the newsgroups in search of a way to systemically output an Access 97 report to a pdf file using the full version of Adobe Acrobat. I want the user...
3
by: Jorge Cecílio | last post by:
Hi! I would like to export some MS-Access reports output to pdf. However, the only possibility offered by Access (afaik) for me to export formatted output is snp (snapshot) (I use MS-Office...
1
by: Jason Huang | last post by:
Hi, In ASP.Net, C#, SQL Server 2000, webform. How do I output data from SQL Server 2000 to a MsWord document, using C# webform? Any help will be appreciated. Jason
13
by: Bev in TX | last post by:
We are using Visual Studio .NET 2003. When using that compiler, the following example code goes into an endless loop in the "while" loop when the /Og optimization option is used: #include...
73
by: Claudio Grondi | last post by:
In the process of learning about some deeper details of Python I am curious if it is possible to write a 'prefix' code assigning to a and b something special, so, that Python gets trapped in an...
6
by: uche | last post by:
This function that I have implemented gives me an infinite loop. I am trying to produce a hexdum program, however, this function is not functioning correctly.....Please help. void...
10
by: linhardt | last post by:
I am wondering how to make ASP.NET output XML instead of HTML. Here is my situation: I am using IE as a front-end to browse company documents. Let's say, a user wants a Word document called...
2
by: clarencelai | last post by:
Hi.. I have a question regarding the DoCmd.OutputTo function. I am automating some email scheduling with file attachments generated from OutPutTo function. However, some of the daily...
0
by: Galka | last post by:
Hello A command DoCmd.OutputTo acOutputReport, "rptCON ONSITE absent students per week", acFormatRTF, "F:/rptCON ONSITE absent students per week.rtf", False worked fine when the database was in...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.