export from an open form

P

pierre

Hi all,

I have a form where a user can select records with listbox
Also he can filter what he want (menu with mouse right click )

I want to export exactly what the user see on his screen to an external
file.

Private Sub cmdExport_Click()
On Error GoTo Err_cmdExport_Click
Dim rst As Recordset
Dim qdf As New QueryDef
Dim strsql As String

Set rst = Forms!frmExport!frmExportSF.Form.RecordsetClone

Set qdf = rst.CopyQueryDef->Unauthorize operation for that type of
object

strsql = qdf.SQL
DoCmd.TransferText acExportDelim, "exportBM", strsql, "test"

How come i have this error?

Regards
 

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