P
Pat
I have a form that allows the user to create a report/letter
which can be previewed or printed with no problem.
I also have on the form a button that will output the report in rtf format
to
a word document that the user can save on his computer.
This button works fine but after the new file is created, the computer does
not have enough memory to move to another program like autocad for example
which
may have been already open.
Is there something that I should be doing to close thing or release some
thing so that this
doesn't happen.
the code includes:
Private Sub Command37_Click() 'SAVE TO FILE
On Error GoTo Err_Command37_Click
Dim DTE, FLNAME As String
Me![E LETER DATE].Format = "MM-DD-YY"
DTE = CStr(Format(Me![E LETER DATE], "MM-DD-YY"))
FLNAME = Me![JOB NUMBER] & " COVER LETTER " & DTE & ".RTF"
'MsgBox FLNAME
If MsgBox("SAVING LETTER TO " & Chr(13) & Chr(10) & FLNAME & " IN MY
DOCUMENTS" & Chr(13) & Chr(10) _
& "TO PROCEED CLICK OK, TO CHANGE FILE NAME OR CANCEL CLICK
CANCEL", vbInformation + vbOKCancel, _
"SAVE TO FILE") = vbOK Then
DoCmd.OutputTo acReport, "COVER LETTER", acFormatRTF, FLNAME, False
Else
DoCmd.OutputTo acOutputReport, "COVER LETTER", acFormatRTF, , False
End If
DoCmd.CLOSE acReport, "cover letter"
Me!SAVED = True
Exit_Command37_Click:
Exit Sub
Err_Command37_Click:
MsgBox Err.DESCRIPTION
Resume Exit_Command37_Click
End Sub
NOTE AGAIN THAT the code executes perfectly well, just have a problem with
memory afterwards
thanks
which can be previewed or printed with no problem.
I also have on the form a button that will output the report in rtf format
to
a word document that the user can save on his computer.
This button works fine but after the new file is created, the computer does
not have enough memory to move to another program like autocad for example
which
may have been already open.
Is there something that I should be doing to close thing or release some
thing so that this
doesn't happen.
the code includes:
Private Sub Command37_Click() 'SAVE TO FILE
On Error GoTo Err_Command37_Click
Dim DTE, FLNAME As String
Me![E LETER DATE].Format = "MM-DD-YY"
DTE = CStr(Format(Me![E LETER DATE], "MM-DD-YY"))
FLNAME = Me![JOB NUMBER] & " COVER LETTER " & DTE & ".RTF"
'MsgBox FLNAME
If MsgBox("SAVING LETTER TO " & Chr(13) & Chr(10) & FLNAME & " IN MY
DOCUMENTS" & Chr(13) & Chr(10) _
& "TO PROCEED CLICK OK, TO CHANGE FILE NAME OR CANCEL CLICK
CANCEL", vbInformation + vbOKCancel, _
"SAVE TO FILE") = vbOK Then
DoCmd.OutputTo acReport, "COVER LETTER", acFormatRTF, FLNAME, False
Else
DoCmd.OutputTo acOutputReport, "COVER LETTER", acFormatRTF, , False
End If
DoCmd.CLOSE acReport, "cover letter"
Me!SAVED = True
Exit_Command37_Click:
Exit Sub
Err_Command37_Click:
MsgBox Err.DESCRIPTION
Resume Exit_Command37_Click
End Sub
NOTE AGAIN THAT the code executes perfectly well, just have a problem with
memory afterwards
thanks