It opens a Export dialog form so that the user must select the directory, supply the file name etc.
I would like to adapt the code so that the Save in field and file name field will be pre filled in with something like
the Save in = App.Path & "\Reports"
file name = txtData(16).Text = .FileName
save as type = HTML
DioI use a common dialog and if so how.
Sub ExportInvoice()
With objRs
If .State <> adStateClosed Then .Close
.ActiveConnection = dbcn
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = adLockBatchOptimistic
If .State <> adStateClosed Then .Close
.CursorLocation = adUseClient
.CursorType = adOpenKeyset
.Source = ("select * from OrderDetails where ID = '" & txtorder(0) & "'")
.Open
Set SalesReport.DataSource = objRs
'code to pre fill dialogue box opened by the next statement
'the Save in = App.Path & "\Reports"
'file name = txtData(16).Text = .FileName
'save as type = HTML
SalesReport.ExportReport rptKeyHTML, , , True
End With
End Sub

New Topic/Question
Reply




MultiQuote





|