Dim strtext1
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb
Set rs = db.OpenRecordset("SELECT * FROM jnptemp ;", dbOpenSnapshot)
rs.MoveLast
rs.MoveFirst
Open bestandsnaam For Output As #1
If rs.RecordCount > 0 Then
rs.MoveFirst
Do Until rs.EOF
strtext1 = rs!Grootboekrekening.Value & ";" & rs!bedrag.Value & ";" & rs!omschrijvingaantal.Value & ";" & rs!omschrijving.Value & ";" & rs!Dagboek.Value & ";" & rs!Stuknummer.Value & ";" & rs!boekingsperiode.Value
rs.MoveNext
Print #1, strtext1 'vult het bestand met data
strtext1 = "" 'parameter resetten
Loop
Else
MsgBox "Er is geen data om te exporteren !!! ", vbInformation
End If
Set rs = Nothing
Close #1
|