none
Access07: rs aus Fo nach Excel RRS feed

  • Frage

  • Hallo,

    mit folgender Funktion wird der rs aus dem Fo korrekt nach Excel geschickt, aber: nur beim ersten Mal - beim zweiten Mal kommt nichts an (also das Formular bleibt offen und zum Beispiel wurde ein neuer Satz eingefügt). Nach Fo Schliessen/Öffnen geht es wieder.

    Geht "Set rs = Frm.RecordsetClone" nur einmal? Vielen Dank für Eure Hilfe. Gruß Steffen 

       
    Public Function ExportExcel(strForm As String)

    Set Frm = Forms(strForm)
    Set rs = Frm.RecordsetClone

    Set xlApp = CreateObject("Excel.Application")
       
        xlApp.Visible = True
        Set xlWB = xlApp.Workbooks.Add
        Set xlSheet = xlWB.Sheets(1)
        xlSheet.cells(2, 2).CopyFromRecordset rs


    rs.Close
    Set rs = Nothing

    Set xlApp = Nothing
    Set xlWB = Nothing
    Set xlSheet = Nothing

    End Function

    Dienstag, 9. April 2013 11:20

Antworten

Alle Antworten