-La exportul datelor dintr-o interogare intr-un fisier txt da" Runtime error 5 invalid procedure call argument"
aceasta eroare apare doar daca unul din campurile interogarii contine diactritice.
Codul VBA este :
Cod: Selectaţi tot
Set rst = CurrentDb.OpenRecordset("SELECT * FROM DetaliiFacturaPtExport WHERE [FacturaId] = " & FacturaId)
Dim fs, TextFile
Set fs = CreateObject("Scripting.FileSystemObject")
Set TextFile = fs.CreateTextFile(Forms!frmHidden!CaleExportMentor.Value & "\Articole.txt", True)
Do Until rst.EOF = True
TextFile.WriteLine ("[ArticoleNoi_" & rst![Cod] & "]")
TextFile.WriteLine ("Denumire=" & rst![Denumire])
TextFile.WriteLine ("Serviciu=N")
TextFile.WriteLine ("ContServiciu=") & vbCrLf
rst.MoveNext
Loop
TextFile.Close
TextFile.WriteLine ("Denumire=" & rst![Denumire])
in cazul in care denumirea contine diacritice