CISA FotoGallery

Statistiche

Tot. visite contenuti : 928186
Home Articoli tecnici Moduli Esportare il Codice di un Modulo in un File Esterno

Esportare il Codice di un Modulo in un File Esterno

'===========================================================================
' COME ESPORTARE IL CODICE DI UN MODULO IN UN FILE
'===========================================================================

Public Sub ExportFormModule(ByVal strFormName As String, _
                           ByVal strTargetDir As String)

    Dim lngFile As Long
    
lngFile = FreeFile()
    Open strTargetDir & "\" & strFormName & ".bas" For Append As lngFile

    DoCmd.OpenForm strFormName, acDesign

    With Forms(strFormName).Module
        Print
#lngFile, .Lines(1, .CountOfLines)
    End With

    
DoCmd.Close acForm, strFormName
    Close lngFile

End Sub
'===========================================================================

Alessandro Baraldi