kelsita_05
Registered User.
- Local time
- Today, 11:02
- Joined
- Aug 23, 2005
- Messages
- 52
I need help with a query situation.
I set up a lovely report based on a joined query. It displays just the way I want:
Job Number Title
My client has to be able to export the data to Excel to share with non-Access users. I was exporting said report to Excel just fine in 2003. But of course, they switched to 2007, and I lost the Export to Excel functionality.
So I was trying to export the query to Excel, but this is what I get:
Job Number Title File Name1
Job Number Title File Name2
Job Number Title File Name etc.
I don't want to see the repeating job number from the main table, so I created a subdatasheet that replicates the look of the report. Problem is I can't export it like that.
So what do I have to do to get an Excel equivalent of the report format in order to make my client happy? I have a command button from a form that was exporting the report with this code:
Private Sub Command73_Click()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "feedback"
stLinkCriteria = "[Job Number]=" & "'" & Me![Job Number] & "'"
DoCmd.OpenReport stDocName, acViewPreview, , stLinkCriteria
DoCmd.OutputTo acOutputReport, stDocName, acFormatXLS, , True
End Sub
Can someone tell me what sort of query I need to set up and how to change my code to run it from my command button?
Thanks!
I set up a lovely report based on a joined query. It displays just the way I want:
Job Number Title
File Name1
File Name2
File Name etc.
File Name2
File Name etc.
My client has to be able to export the data to Excel to share with non-Access users. I was exporting said report to Excel just fine in 2003. But of course, they switched to 2007, and I lost the Export to Excel functionality.
So I was trying to export the query to Excel, but this is what I get:
Job Number Title File Name1
Job Number Title File Name2
Job Number Title File Name etc.
I don't want to see the repeating job number from the main table, so I created a subdatasheet that replicates the look of the report. Problem is I can't export it like that.
So what do I have to do to get an Excel equivalent of the report format in order to make my client happy? I have a command button from a form that was exporting the report with this code:
Private Sub Command73_Click()
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "feedback"
stLinkCriteria = "[Job Number]=" & "'" & Me![Job Number] & "'"
DoCmd.OpenReport stDocName, acViewPreview, , stLinkCriteria
DoCmd.OutputTo acOutputReport, stDocName, acFormatXLS, , True
End Sub
Can someone tell me what sort of query I need to set up and how to change my code to run it from my command button?
Thanks!