
DoCmd.TransferText acExportDelim, , "ชื่อ Tabale หรือ Query", "Path และชื่อไฟล์ ที่ต้องการ", True
ตัวอย่าง
DoCmd.TransferText acExportDelim, , "EXP_HISTORY_SUMMARY", "C:\Program Files\Shop \QRYTEST.txt", True
DoCmd.TransferSpreadsheet = Export เป็น Excel File
DoCmd.TransferText = Export เป็น Text File
ถ้าเราต้องการให้ทำการเปิดไฟล์ ใช้คำสั่ง
ตัวอย่าง
Public Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hWnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Dim handle As Long
Dim strFileName As String
strFileName = "C:\Program Files\Shop History\QRYTEST.txt"
handle = ShellExecute(0, "Open", strFileName, 0, 0, 1)
0 ความคิดเห็น:
แสดงความคิดเห็น