Hi Him mah,
Boleh coba sub ini....
Sub EmptyAllTable()
Dim dbs As Database
Dim i As Integer
Set dbs = CurrentDb()
dbs.TableDefs.Refresh
DoCmd.SetWarnings False
For i = 0 To dbs.TableDefs.Count - 1
If dbs.TableDefs(i).Attributes = 0 Then
DoCmd.RunSQL "Delete * from " & dbs.TableDefs(i).Name
End If
Next i
DoCmd.SetWarnings True
Set dbs = Nothing
End Sub
Salam...
________________________________
From: [email protected]
[mailto:[email protected]] On Behalf Of Aan Nadiman
Sent: Thursday, October 15, 2009 12:02 AM
To: [email protected]
Subject: Bls: [belajar-access] Menghapus semua isi tabel yg ada dalam
file access
kalo pakai query delete...??
DoCmd.SetWarnings False
tsql = "delete from tbl_bpb" 'tbl_bpb adalah contoh nama tabel
yg mau dihapus
DoCmd.RunSQL tsql
--- Pada Sel, 13/10/09, him mah <[email protected]> menulis:
Dari: him mah <[email protected]>
Judul: [belajar-access] Menghapus semua isi tabel yg ada dalam
file access
Kepada: [email protected]
Tanggal: Selasa, 13 Oktober, 2009, 4:00 PM
maaf mau minta tolong. Bagaimana script atau macrn
o untuk menghapus semua isi table pada file access. misal kita
punya 5
tabel. dgn menjalankan macro maka semua record yg ada dalam 5
tabel
tsb terhapvs. makasih
________________________________
Yahoo! Mail Kini Lebih Cepat dan Lebih Bersih. Rasakan bedanya sekarang!
<http://id.mail.yahoo.com>
-----------------------------------------
----------------------------------------------------------
This transmission is CONFIDENTIAL and the information is intended
only for the use of the individual or entity to whom it is
addressed. If you are not the intended recipient, or the employee
or agent responsible for delivering it to the intended recipient,
you are hereby notified that any use, dissemination, distribution
or copying of this communication is STRICTLY PROHIBITED. If you
have received the transmission in error, please immediately notify
us by email and/or telephone, and delete the transmission and any
attachments from your mailbox. Thank you.