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

Output Report into RTF format error 13

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.