สอบถามการ print report แต่ไปออกฟอร์มแทน


0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้

25 ม.ค. 61 , 08:39:55
อ่าน 1381 ครั้ง

tomkungz

คือผมทำปุ่มคิวรี่จากหน้าฟอร์ม ให้ไปรันคิวรี่แล้วเปิด report เพื่อจะปริ้น
ซึ่งก็ preview หน้าที่ถูกต้องครับ
แต่พอกดสั่งปริ้น ดันปริ้นหน้า form ออกมาแทน เกิดจากอะไรได้บ้างครับ

 

26 ม.ค. 61 , 15:29:50
ตอบกลับ #1

pizza_p

> สอบถามการ print report แต่ไปออกฟอร์มแทน
« ตอบกลับ #1 เมื่อ: 26 ม.ค. 61 , 15:29:50 »
ปุ่มคำสั่งมันอยู่บนฟอร์ม คำสั่งที่ใช้พิมพ์คงเป็นการสั่งพิมพ์ปกติบนฟอร์ม ถ้าจะพิมพ์ report โดยปุ่มอยู่บนฟอร์มให้ใช้

DoCmd.OpenReport "ชื่อ Report", acViewNormal

 

30 ม.ค. 61 , 17:09:34
ตอบกลับ #2

tomkungz

> สอบถามการ print report แต่ไปออกฟอร์มแทน
« ตอบกลับ #2 เมื่อ: 30 ม.ค. 61 , 17:09:34 »
ขออภัยครับหายไปหลายวัน
คือผมใช้คำสั่ง นั้นล่ะครับ แต่สงสัยว่าเพราะรายงานไม่มี เลขที่หรือป่าว ระบบเลยปริ้นไม่ออก

If OP1.Value = -1 And rpSite.Value = "ALL" Then
    strCriteria = "[EmpYear] >= " & RpYearS & " and [EmpYear] <= " & RpYearE & " and [EmpMonth] >= " & RpMonthS & " and [EmpMonth] <= " & RpMonthE & " and [empday] >= " & RpDateS & " and [empday] <= " & RpDateE
    ElseIf OP1.Value = -1 Then
    strCriteria = "[Emp_Branch] = '" & rpSite.Value & "' and [EmpYear] >= " & RpYearS & " and [EmpYear] <= " & RpYearE & " and [EmpMonth] >= " & RpMonthS & " and [EmpMonth] <= " & RpMonthE & " and [empday] >= " & RpDateS & " and [empday] <= " & RpDateE
    ElseIf OP2.Value = -1 Then
    strCriteria = "[EMP_ID] = '" & rpIDEmp & "'"
End If
    strReport = "รายงานประจำวัน"
    docmd.OpenReport strReport, acViewReport, , strCriteria, acWindowNormal

 


บอร์ดเรียนรู้ Access สำหรับคนไทย


 

Sitemap 1 2 3 4 5