Excel Output From Form

paulS30berks

Registered User.
Local time
Today, 03:56
Joined
Jul 19, 2005
Messages
116
I have written some code that will output to a spreadsheet in a given location:

how can I rework this code so that the excel output displays on screen rather than saving to a specified location:

Code Written:

Private Sub outputToExcel_Click()
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "C4C Period Final", "\\uk.michaelpage.local\dfs\GroupData\NSCH\Elite Database Reports\Gross Cash For Car.xls"
MsgBox "C4C Period Final Exported"

End Sub
 
you are exporting the query or form "C4C Period Final"

simply display this on your terminal

Private Sub outputToExcel_Click()
docmd.openquery "C4C Period Final"
'you can suspend action until you close this
while isopen(""C4C Period Final"")
doevents
wend

'and get confirmation
if msgbox("confirm you wish to send the details",vbokcancel)=vbcancel then
exit sub
end if


DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, "C4C Period Final", "\\uk.michaelpage.local\dfs\GroupData\NSCH\Eli te Database Reports\Gross Cash For Car.xls"
MsgBox "C4C Period Final Exported"

to do this you need a function call for isopen

see this link

http://www.access-programmers.co.uk/forums/showthread.php?p=535183&highlight=isopen#post535183
 

Users who are viewing this thread

Back
Top Bottom