send to file button

G

Guest

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!
 
G

Guest

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.
 
G

Guest

I'm rather a novice so I'm not quite understanding. How would I write the
OpenArgs? Not real sure what you mean.
 
G

Guest

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.
 
G

Guest

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
 
G

Guest

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?

JohnLute said:
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


Klatuu said:
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.
 
G

Guest

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


Klatuu said:
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?

JohnLute said:
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


Klatuu said:
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!
 
G

Guest

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



JohnLute said:
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


Klatuu said:
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?

JohnLute said:
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!
 
G

Guest

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


Klatuu said:
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



JohnLute said:
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


Klatuu said:
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!
 
G

Guest

Sorry, John, I can't help there. All I know is that .rtf can be read by
Word, but .doc files have a different and more robust format. I'm glad we
figured out the other part, though. I did find this in Access Help that may,
although disappointing, be informative:

If you output the data in a report, the only controls that are included in
the output file are text boxes (for .xls output files), or text boxes and
labels (for .rtf, .txt, and .html output files). All other controls are
ignored. Header and footer information is also not included in the output
file. The only exception to this is that when you output the data in a report
to a Microsoft Excel file, a text box in a group footer containing an
expression with the Sum function is included in the output file. No other
control in a header or footer (and no aggregate function other than the Sum
function) is included in the output file.



JohnLute said:
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


Klatuu said:
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



JohnLute said:
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!
 
G

Guest

Thanks, again! Yes - this is informative but disappointing. I'll have to
review my options and see what the best way to export Access reports will be
for us.

I really appreciate your help!

--
www.Marzetti.com


Klatuu said:
Sorry, John, I can't help there. All I know is that .rtf can be read by
Word, but .doc files have a different and more robust format. I'm glad we
figured out the other part, though. I did find this in Access Help that may,
although disappointing, be informative:

If you output the data in a report, the only controls that are included in
the output file are text boxes (for .xls output files), or text boxes and
labels (for .rtf, .txt, and .html output files). All other controls are
ignored. Header and footer information is also not included in the output
file. The only exception to this is that when you output the data in a report
to a Microsoft Excel file, a text box in a group footer containing an
expression with the Sum function is included in the output file. No other
control in a header or footer (and no aggregate function other than the Sum
function) is included in the output file.



JohnLute said:
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


Klatuu said:
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!
 
G

Guest

Happy to help. Sorry we didn't get what we wanted. Is it not possible to
just print the report? I assume the answer is no, or you would not be going
through all this.

JohnLute said:
Thanks, again! Yes - this is informative but disappointing. I'll have to
review my options and see what the best way to export Access reports will be
for us.

I really appreciate your help!

--
www.Marzetti.com


Klatuu said:
Sorry, John, I can't help there. All I know is that .rtf can be read by
Word, but .doc files have a different and more robust format. I'm glad we
figured out the other part, though. I did find this in Access Help that may,
although disappointing, be informative:

If you output the data in a report, the only controls that are included in
the output file are text boxes (for .xls output files), or text boxes and
labels (for .rtf, .txt, and .html output files). All other controls are
ignored. Header and footer information is also not included in the output
file. The only exception to this is that when you output the data in a report
to a Microsoft Excel file, a text box in a group footer containing an
expression with the Sum function is included in the output file. No other
control in a header or footer (and no aggregate function other than the Sum
function) is included in the output file.



JohnLute said:
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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top