473,473 Members | 1,917 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Output Report into RTF format error 13

Hello
All of a sudden I started getting error 13, type mismatch in a
command, which was running happily for years. Here is a code:

Option Compare Database
Option Explicit
Dim CmdClose1_Clicked As Boolean, CmdClose_Clicked As Boolean
Private Sub CmdClose_Click()
On Error GoTo Err_CmdClose_Click
'Check, if there are any messages marked to delete
Dim myRSet As DAO.Recordset, myDB As DAO.Database, myQuery As
DAO.QueryDef, mySQL As String, myReportQuery As DAO.QueryDef
Dim myCorrectionsRSet As DAO.Recordset, myUsers() As String, N As
Integer, NN As Integer
Dim OutputName As String, rptName As String, FileName As String, Msg
As String

Set myDB = CurrentDb

rptName = "Corrections to Course in EBS for mail to send to users"
FileName = "Changes" & Day(Now()) & Month(Now()) & Year(Now()) &
myUsers(NN, 0) & ".rtf"
OutputName = "F:\My Documents\" & FileName

DoCmd.OutputTo acOutputReport, rptName, acFormatRTF, OutputName, False

The last command to output the report as MS Word file returns the
error 13, type mismatch. References ticked:
Visual Basic for Applications
Microsoft Access 9.0 Object Library
Microsoft Excel 9.0 Object Library
OLE Automation
Microsoft DAO 3.6 Object Library
Microsoft Visual Basic for Applications Extensibility 5.3
The order is as in Available References.

The main thing that this code has been working for years, which
puzzles me most.
Any help will be greatly appreciated.
Galina
Nov 13 '05 #1
2 2460
Try looking at this article and see if it helps.
http://support.microsoft.com/default...-us;105171#kb3

Omey

"Galina" <ga****@mail.ru> wrote in message
news:ec************************@posting.google.com ...
Hello
All of a sudden I started getting error 13, type mismatch in a
command, which was running happily for years. Here is a code:

Option Compare Database
Option Explicit
Dim CmdClose1_Clicked As Boolean, CmdClose_Clicked As Boolean
Private Sub CmdClose_Click()
On Error GoTo Err_CmdClose_Click
'Check, if there are any messages marked to delete
Dim myRSet As DAO.Recordset, myDB As DAO.Database, myQuery As
DAO.QueryDef, mySQL As String, myReportQuery As DAO.QueryDef
Dim myCorrectionsRSet As DAO.Recordset, myUsers() As String, N As
Integer, NN As Integer
Dim OutputName As String, rptName As String, FileName As String, Msg
As String

Set myDB = CurrentDb

rptName = "Corrections to Course in EBS for mail to send to users"
FileName = "Changes" & Day(Now()) & Month(Now()) & Year(Now()) &
myUsers(NN, 0) & ".rtf"
OutputName = "F:\My Documents\" & FileName

DoCmd.OutputTo acOutputReport, rptName, acFormatRTF, OutputName, False

The last command to output the report as MS Word file returns the
error 13, type mismatch. References ticked:
Visual Basic for Applications
Microsoft Access 9.0 Object Library
Microsoft Excel 9.0 Object Library
OLE Automation
Microsoft DAO 3.6 Object Library
Microsoft Visual Basic for Applications Extensibility 5.3
The order is as in Available References.

The main thing that this code has been working for years, which
puzzles me most.
Any help will be greatly appreciated.
Galina

Nov 13 '05 #2
Omey
Thank you for answering. It is very useful article, but no, it doesn't
help in my case. I did check SQL of the query under the report and it
is all right.

Since yerturday, I narrowed the problem: this report has got a
subreport, which give this error 13, when outputted into MS Word. In
give this error, even when outputted from the report view, not only in
code.

Rather then investigating, why all of a suddden I cannot output the
report with subreport into MS Word, I'll try to ask my customers, if
they really need this subreport.
Best regards
Galina

"Omey Samaroo" <respond2_group@com> wrote in message news:<tq********************@rogers.com>...
Try looking at this article and see if it helps.
http://support.microsoft.com/default...-us;105171#kb3

Omey

"Galina" <ga****@mail.ru> wrote in message
news:ec************************@posting.google.com ...
Hello
All of a sudden I started getting error 13, type mismatch in a
command, which was running happily for years. Here is a code:

Option Compare Database
Option Explicit
Dim CmdClose1_Clicked As Boolean, CmdClose_Clicked As Boolean
Private Sub CmdClose_Click()
On Error GoTo Err_CmdClose_Click
'Check, if there are any messages marked to delete
Dim myRSet As DAO.Recordset, myDB As DAO.Database, myQuery As
DAO.QueryDef, mySQL As String, myReportQuery As DAO.QueryDef
Dim myCorrectionsRSet As DAO.Recordset, myUsers() As String, N As
Integer, NN As Integer
Dim OutputName As String, rptName As String, FileName As String, Msg
As String

Set myDB = CurrentDb

rptName = "Corrections to Course in EBS for mail to send to users"
FileName = "Changes" & Day(Now()) & Month(Now()) & Year(Now()) &
myUsers(NN, 0) & ".rtf"
OutputName = "F:\My Documents\" & FileName

DoCmd.OutputTo acOutputReport, rptName, acFormatRTF, OutputName, False

The last command to output the report as MS Word file returns the
error 13, type mismatch. References ticked:
Visual Basic for Applications
Microsoft Access 9.0 Object Library
Microsoft Excel 9.0 Object Library
OLE Automation
Microsoft DAO 3.6 Object Library
Microsoft Visual Basic for Applications Extensibility 5.3
The order is as in Available References.

The main thing that this code has been working for years, which
puzzles me most.
Any help will be greatly appreciated.
Galina

Nov 13 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Dalan | last post by:
Perhaps someone has experienced this problem. I developed an Access 97 Runtime database on a Windows 98 SE machine. I have three reports that can be optionally copied to a floppy disk or hard drive...
1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
5
by: Mal | last post by:
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...
9
by: Colin McGuire | last post by:
Hi, I have an report in Microsoft Access and it displays everything in the table. One column called "DECISION" in the table has either 1,2, or 3 in it. On my report it displays 1, 2, or 3. I want...
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: rubikzube* | last post by:
I am attempting to place a call to make via System.Diagnostics.Process using the sample code below. If I comment out the two problem lines indicated, then the code runs smoothly and make performs...
2
by: Arnold | last post by:
Greetings Gurus, In a report showing the names of students and their progress, I am getting an error in the name field (Name: #Error). The report gets its data from an unbound form containing...
2
by: johnperl | last post by:
i am working on the script as below, i want an output according to the format. i am trying to put everything in one loop but cannot figure out the way to do so. could anyone please help me with this....
2
by: Suzanne801 | last post by:
Hi, I am new to VB and trying to get Excel output from Access 2007-Report using: DoCmd.OutputTo acOutputReport, rptName, acFormatXLSX, OFileName, True I keep on getting: Run-time error...
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...
1
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...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.