Print a report automatically on a certain Day
กระทู้เก่าบอร์ด อ.สุภาพ ไชยา

 268   1
URL.หัวข้อ / URL
Print a report automatically on a certain Day

ถามไว้ที่ http://www.utteraccess.com/forums/showflat.php?Cat=&Board=access_97&Number=222042

เขาต้องการพิมพ์รายงานทุกวันศุกร์ โดยให้เปิดโปรแกรมเข้ามาแล้วให้พิมพ์ออกเครื่องปริ้นเตอร์เลย

ผมเลยแนะนำให้เขาใช้โค้ดข้างล่างนี้ โดยใช้การสร้างไฟล์ txt ไว้ตัวหนึ่ง เพื่อใช้ตรวจว่ามีการพิมพ์รายงานออกไปแล้วหรือยัง

Private Sub Form_Load()
Dim strPrinted As String
strPrinted = "c:\printed.txt"
If Format(Date, "ddd") = "Fri" Then
If Dir(strPrinted) = "" Then
Open strPrinted For Output As #1
Close #1
DoCmd.OpenReport "Report1"
End If
Else
' Delete printed.txt file.
Kill strPrinted
End If
End Sub

1 Reply in this Topic. Dispaly 1 pages and you are on page number 1

1 @R06730
   
@ ประกาศใช้งานเว็บบอร์ดใหม่ => บอร์ดเรียนรู้ Access สำหรับคนไทย
แล้วจะใส่ลิ้งอ้างอิงมาที่โพสต์เก่านี้หรือไม่ก็ตามสะดวกครับ
Time: 0.0467s