1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| Public Function exportcommandeSob()
Dim temp As String
Dim rs As Recordset
On Error GoTo err_exportcommandeSob:
temp = getCommandesDir & "temp" & ".csv"
If Dir(temp) = "" Then Kill temp
intFic = FreeFile
Open temp For Output As intFic
Set rs = CurrentDb.OpenRecordset("Select * from commande where ComID <> 0" & ComID & ";")
With rs
Print #intFic, rs!ComCode & ";" & rs!ComRef & ";" & rs!Email & ";" & rs!Commentaire
End With
Set rs = CurrentDb.OpenRecordset("Select * from commandedetail WHERE ComID <> 0" & ComID & ";")
With rs
Do Until .EOF
Print #intFic, rs!MedicRef & ";" & rs!QuantiteCondPrim
rs.MoveNext
Loop
End With
Close intFic
Set rs = Nothing |
Partager