sql "SELECT * FROM TableDevis, TableFacturation WHERE TableDevis.[N°deDevis] TableFacturation.[N°deDevis] AND TableFacturation.Date >= '#" & Me.Texte0 & "#' AND TableFacturation.Date <= '#" & Me.Texte2 & "#' AND TableFacturation.export = False"
SELECT * FROM TableFacturation WHERE TablaFacturation.Date >= '#10/05/2004#' AND TablaFacturation.Date >= '#15/05/2004#' AND TableFacturation.export = False
Type de données incompatibles dans l'expression du critère.
Dim updte As String Dim db As Database Dim rssql As DAO.Recordset Dim sql As String sql = "" Set db = DBEngine(0)(0) sql = "SELECT * FROM TableFacturation WHERE TableFacturation.Date >= '#" & Me.Texte0 & "#' AND TableFacturation.Date <= '#" & Me.Texte2 & "#' AND TableFacturation.export = False" MsgBox (sql) Set rssql = db.OpenRecordset(sql) Set EnrFich = CreateObject("Scripting.FileSystemObject") 'Création objet On Error Resume Next Set FicLog = EnrFich.CreateTextFile(App.Path & "\MonFichier.txt", False) Set FicLog = EnrFich.GetFile(App.Path & "\MonFichier.txt") 'Chargement du fichier Set FicLogBis = FicLog.OpenAsTextStream(8, -2) 'Ouverture du fichier While Not rssql.EOF FicLogBis.WriteLine (rssql("N°Facturation") & ";" & rssql("HT")) 'Ecriture dans le fichier updte "UPDATE TableFacturation SET export True WHERE N°Facturation = " & rssql.Fields("N°Facturation") MsgBox (updte) DoCmd.RunSQL updte rssql.MoveNext Wend FicLogBis.Close 'Fermeture Set FicLogBis = Nothing FicLog.Close 'Fermeture du fichier Set FicLog = Nothing