pinkis4girls
New member
- Local time
- Today, 00:04
- Joined
- Mar 24, 2007
- Messages
- 9
I have double posted this under forms and reports, as I'm not sure which place it is best suited.
Hi,
I'm sure I'm not the first and won’t be the last to ask this. I'm trying to create my report with a dynamic file name from one of the text boxes [Tender Name] in my form/report.
Currently I have;
Private Sub Quoterequest_Click()
Dim stDocName As String
[Contract Reason].Value = "Normal" Then
stDocName = "Quote Request wip"
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport stDocName, acPreview, , "[Ref]= forms!Tenderdata![Ref]"
DoCmd.OutputTo acReport, stDocName, acFormatRTF, "C:\TEMP\quotation.doc", True
DoCmd.Close acReport, "Quote Request wip"
End Sub
I'm assuming this is a simple change required to;
DoCmd.OpenReport stDocName, acPreview, , "[Ref]= forms!Tenderdata![Ref]"
DoCmd.OutputTo acReport, stDocName, acFormatRTF, "C:\TEMP\quotation.doc", True
But I've tried a few things and it's not changing the saved filed name.
Any help will be much appreciated, just a nudge in the right direction; I have tried searching for an answer already posted but can’t kind find a simple solution. I’m sure I have done this before but can’t remember how (all my notes were deleted in a rather upsetting USB stick incident a couple of months ago).
Hi,
I'm sure I'm not the first and won’t be the last to ask this. I'm trying to create my report with a dynamic file name from one of the text boxes [Tender Name] in my form/report.
Currently I have;
Private Sub Quoterequest_Click()
Dim stDocName As String
[Contract Reason].Value = "Normal" Then
stDocName = "Quote Request wip"
DoCmd.RunCommand acCmdSaveRecord
DoCmd.OpenReport stDocName, acPreview, , "[Ref]= forms!Tenderdata![Ref]"
DoCmd.OutputTo acReport, stDocName, acFormatRTF, "C:\TEMP\quotation.doc", True
DoCmd.Close acReport, "Quote Request wip"
End Sub
I'm assuming this is a simple change required to;
DoCmd.OpenReport stDocName, acPreview, , "[Ref]= forms!Tenderdata![Ref]"
DoCmd.OutputTo acReport, stDocName, acFormatRTF, "C:\TEMP\quotation.doc", True
But I've tried a few things and it's not changing the saved filed name.
Any help will be much appreciated, just a nudge in the right direction; I have tried searching for an answer already posted but can’t kind find a simple solution. I’m sure I have done this before but can’t remember how (all my notes were deleted in a rather upsetting USB stick incident a couple of months ago).