Senin, 29 Oktober 2012

Re: [belajar-access] Export access dengan macro menjadi csv

Dear Pak Malik, silahkan dicoba procedure berikut:

Private Sub cmdExportCSV_Click()
If IsNull(Me![txtAlamatFile]) Or Right(Me![txtAlamatFile], 4) <> ".csv"
Then
MsgBox "Isi dahulu dengan benar alamat csv file nya."
[txtAlamatFile].SetFocus
Exit Sub
End If
Dim db As DAO.Database
Dim rs As DAO.Recordset
Set db = CurrentDb()
Set rs = db.OpenRecordset("qryBCAGabungan", dbReadOnly)
Open Me![txtAlamatFile] For Output As #1
Do While Not rs.EOF
Print #1, rs![Field]
rs.MoveNext
Loop
Close #1
CloseMe:
rs.Close
Set rs = Nothing
db.Close
Set db = Nothing
MsgBox "Proses sudah selesai."
Shell "Notepad.exe " & Me![txtAlamatFile], vbMaximizedFocus
End Sub

Sudah saya coba untuk export text file Payroll BCA menggunakan procedure
diatas, dan berhasil. Tinggal diubah nama query/table dan nama field
alamatnya.

Wassalaamu'alaikum Warahmatullahi Wabarakatuh,
Sofyan Efendi
http://imopi.wordpress.com | http://trendmuslim.com
----- Original Message -----
From: <malik.nugraha@gmail.com>
To: <belajar-access@yahoogroups.com>
Sent: Tuesday, October 30, 2012 8:24 AM
Subject: [belajar-access] Export access dengan macro menjadi csv


> Dear para pakar access,
>
> Saya lagi mencoba untuk export beberapa database pada tabel dan dirubah
> jadi csv, namun setelah saya mencoba dengan macro tidak berhasil,
> bagaimana ya cara export dgn macro access?
>
>
> Salam hangat
>
>
> Malik
> Powered by Telkomsel BlackBerry®
>
> ------------------------------------
>
> SPAM IS PROHIBITEDYahoo! Groups Links
>
>
>
>



------------------------------------

SPAM IS PROHIBITEDYahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/belajar-access/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/belajar-access/join
(Yahoo! ID required)

<*> To change settings via email:
belajar-access-digest@yahoogroups.com
belajar-access-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
belajar-access-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/

Tidak ada komentar:

Posting Komentar