YES!!!
That did the trick. THANKS!
Any idea why it opens in Word with so many formatting problems? For example,
an embedded graphic from the report doesn't export into Word. Also, I have
some group option radio buttons that only appear blank in the Word file.
--
www.Marzetti.com
:
Okay, I checked and the Outputto method has not changed, but the light just
came on. In the report you are sending to an .rtf file, set the report's
Filter property to filter on the textbox.
Filter Forms![frmFinishedGoods].form![txtProfileID]
Filteron True
Then:
stDocName = "rptFinishedGoods"
DoCmd.OutputTo acReport, stDocName, acFormatRTF, "C:\FinishedGood.doc", True
:
I'm a little lost, too! Like I said, I'm a novice so what I'm doing may not
be making sense. I'm using Access 2002.
In any case, I'm trying to get the button to output only the opened record
in the form: tblProfiles.txtProfileID
Sorry - I'm probably not expressing this very well.
--
www.Marzetti.com
:
Sorry, John, I am a little lost. What version of Access are you using? I
have 2000 and the Output To you are using does not match the Output To as I
know it (checked the help fie) and the argumentss are:
Object Type, Object Name, Output Format, Auto Start, and Template.
In this case, you would not use the template argument. It is only for html,
htx, and asp files. Am I missing something here?
:
Thanks, Klatuu! Here's what I've done but it's not working. Do you see the
problem? The error message is: "An expression you entered is the wrong data
type for one of the arguments."
Private Sub cmdFGSpectoMSWord_Click()
On Error GoTo Err_cmdFGSpectoMSWord_Click
Dim stDocName As String
stDocName = "rptFinishedGoods"
DoCmd.OutputTo acReport, stDocName, acFormatRTF, ,
"[tblProfiles.txtProfileID] = Forms![frmFinishedGoods].form![txtProfileID]",
"C:\FinishedGood.doc", -1
Exit_cmdFGSpectoMSWord_Click:
Exit Sub
Err_cmdFGSpectoMSWord_Click:
MsgBox Err.Description
Resume Exit_cmdFGSpectoMSWord_Click
End Sub
--
www.Marzetti.com
:
Sorry, I was thinking of Forms. There is no Openargs for reports; however,
the Where condition of the OpenReport method will do what you want. You can
get detailed information in Access Help. Read that, then if you still have
questions, post back and we can make it happen.
:
I'm rather a novice so I'm not quite understanding. How would I write the
OpenArgs? Not real sure what you mean.
--
www.Marzetti.com
:
How about use the OpenArgs for the report and send a unique identifer for the
record. Then in the datasource for the report, set a filter that will permit
only the record you want printed? Have not tested this, it is only a concept.
:
I've just created a send to file button and it works fine except that it
wants to send every record into the file.
Here's the code:
Private Sub cmdFGSpectoMSWord_Click()
On Error GoTo Err_cmdFGSpectoMSWord_Click
Dim stDocName As String
stDocName = "rptFinishedGoods"
DoCmd.OutputTo acReport, stDocName, acFormatRTF, "C:\FinishedGood.doc", -1
Exit_cmdFGSpectoMSWord_Click:
Exit Sub
Err_cmdFGSpectoMSWord_Click:
MsgBox Err.Description
Resume Exit_cmdFGSpectoMSWord_Click
End Sub
How can I edit this to send only the open record? The record source for the
report is:
SELECT tblProfiles.*, tblProfiles.Type, tblFinishedGoods.Group
FROM tblProfiles INNER JOIN tblFinishedGoods ON tblProfiles.txtProfileID =
tblFinishedGoods.txtProfileID
WHERE (((tblProfiles.Type)="FG"));
Any help would be appreciated!