แสดงกระทู้

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - sjs

หน้า: 1 2 [3] 4 5
37
เป็นการไป lookup ข้อมูลมาที่ละตาราง แล้วแบบนี้ถ้าสร้าง Query join ตารางมาแล้วใส่เงื่อนไขแล้วเอามาโชว์ทีเดียวจะไวกว่าไหมครับ อันนี้แค่สงสัยนะครับ 

38

ลองใช้ .WriteLine แทน .Write ดูครับ

39
อ่านแล้วเหมือน ๆ ที่เคยทำไว้ลองเปิดเล่นดูนะครับ
user admin : somjate
password : sjsa0786

ข้างในรวม ๆ code ต่างๆ , การสร้างรายงาน 12 เดือน , การกำหนดสิทธ์และอื่น ๆ


Code นี้ได้มาจากอาจารย์ในเว็บ อ.ฺBADMan และหลาย ๆ ท่าน ขอบคุณทุก ๆ ท่านครับ




41
อ้างถึง Textbox ในฟอร์มหลัก แบบนี้ครับ   = [Forms]![ชื่อฟอร์มหลัก]![ชื่อTextbox]


42
[Date] นี่ชื่อฟิลด์หรือเปล่าครับ
หรือ Date() เรียกวันที่จากระบบ

43
สำหรับ Gmail ใช้อันนี้ได้ครับ
https://wellsr.com/vba/2020/excel/vba-send-email-with-gmail/
แล้วก็เปิด App password gmail นำพาสที่ได้มาใช้ครับ

44
ห้อง MS Access / : การใช้งาน SQL Server กับ MS Access
« เมื่อ: 23 ก.ย. 63 , 16:07:05 »
1.ดึงมาใช้ได้นะครับ
2.อันนี้ผมไม่เคยส่วนมากที่ใช้จะเขียนใหม่เลยครับแต่คิดว่าคงได้บางอย่างครับ


45
งานที่ทำเป็นการ Link Table MS SQL server มาหรือเปล่าครับ ถ้าใช่ลองสร้าง Query ใส่เงื่อนไขที่Field  [Dates] = = =Forms!frmSearchCertificate!txtApplyDate  แล้ว view ดูข้อมูลได้ไหมครับ

46
ห้อง MS Access / : สอบถามเรื่องDCount ค่ะ
« เมื่อ: 10 ก.ย. 63 , 20:46:55 »
proReq_start_date--> ชื่อฟิลด์ก็บราคา === ชื่อฟิลด์วันที่เปล่าครับ ถ้าใช่ก็ใช้ #field# กับวันที่
com_price = DCount("[Pro_pro]", "[qry_Assess with details]", "[Pro_pro]= " & Pro_pro & " And [proReq_start_date]=#" & Me.proReq_start_date & "#")

48
ลองเปิด csv ด้วย notepad > Save UTF-8 ดูก่อน นำเข้าดูครับ



49
ห้อง MS Access / : ส่ง line notify ไม่ได้ครับ
« เมื่อ: 28 พ.ค. 63 , 22:36:23 »
ลองเล่นนี้มาก็ใช้ดีเลยนะครับ 

https://medium.com/@thiravut.golf/%E0%B8%97%E0%B8%B3%E0%B9%83%E0%B8%AB%E0%B9%89-line-bot-%E0%B8%94%E0%B8%B6%E0%B8%87%E0%B8%82%E0%B9%89%E0%B8%AD%E0%B8%A1%E0%B8%B9%E0%B8%A5%E0%B8%88%E0%B8%B2%E0%B8%81-google-sheet-%E0%B8%94%E0%B9%89%E0%B8%A7%E0%B8%A2-dialogflow-89e50b184533

ทำ line ตอบคำถามดึงข้อมูลจากฐานข้อมูลมาตอบ ยังไม่มีที่ใช้ฐานข้อมูลจาก Access

50
ทำ Query Distinct แบบนี้ได้ไหม
SELECT DISTINCT Quater, SuppliersQTarget, ...
FROM Q_0KADAIQ1;

51
ภาพตัวอย่างรายงานที่ได้ ขอตัดเป็นภาพมาให้ดูนะ

ภาพที่ 1 หน้าแรก


ภาพที่ 2 จะได้ยอดยกมาและยอดรวม



และหน้าสุดท้ายก็จะได้ยอดรวมครับ





52
หน้าออกแบบรายงาน



กำหนดให้รวม Property Sheet : Running Sum = Over All




โค๊ด: [Select]
Option Compare Database

Dim x As Double
Dim X2 As Double
Dim P1(100)
Dim P2(100)

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Forms!menu.Frame3B = 1 Then
                If IsNull(Forms!menu.txtPath) Then
                    Me.ImgTax3.Picture = none
                Else
                    Me.ImgTax3.Picture = Forms!menu.txtPath
                End If
End If
End Sub

Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
  If IsNull(Me.Text4.Value) = True Then
        Me.Text59.ForeColor = RGB(255, 255, 255)
  End If
    Me.Text84.Value = " ลำดับที่ในหนังสือรับรองฯ  "
End Sub
Private Sub PageFooterSection_Print(Cancel As Integer, PrintCount As Integer)
Me!PageSum = Me!RunSum - x
x = Me!RunSum
 
Me!PageSum3 = Me!RunSum3 - X2
X2 = Me!RunSum3
            P1(Page) = RunSum
            P2(Page) = RunSum3
Call SetLableRPT1
End Sub
Sub SetLableRPT1()
On Error Resume Next
    Me.rptlblname.Caption = "(" & Forms!menu.Combo41 & ")"
    Me.rptlblposition.Caption = Forms!menu.Combo45
    Me.rptlblsenderdate.Caption = Forms!menu.lblDate.Caption
  ' Me.rptlblRptCode2.Caption = "นำไปรวมกับใบต่อ ภ.ง.ด.53 ฉบับอื่น (ถ้ามี))"
End Sub

Private Sub PageHeaderSection_Print(Cancel As Integer, PrintCount As Integer)
Dim P As Double
   If Forms!menu!FrameA.Value = 1 Then
        Me.lblFac.Caption = "สาขาเลขที่... " & Forms!menu!Fac.Column(0) & "....." & Forms!menu!Fac.Column(1) & "...."
    End If
    Me.txtP1 = P1(Page - 1)
    Me.txtP2 = P2(Page - 1)
End Sub

Private Sub Report_NoData(Cancel As Integer)
    MsgBox "Nodata "
    Cancel = True
End Sub

Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)
  ' Me.rptlblRptCode.Caption = Forms!menu!reportcode.Column(1)
    Me.Text65.Value = "ยอดยกมา"
      x = 0
        X2 = 0
End Sub


ข้างหลังเขียนโค๊ดแบบนี้ครับ ลองดูนะครับผมเอามาทั้งหมดเลยที่อยู่หลัง Report นี้


53
ใส่กรอบรูปกำหนดที่อยู่ไฟล์
ในภาพตัวอย่างใช้ภาพลายเซ็นใส่ไว้ในท้ายรายงาน
ส่วนจำนวนข้อมูลในรายงานก็กำหนดจำนวนบรรทัดจะให้แสดงกี่บรรทัด
ก็จะได้รูปแบบหน้าทีเป็นแบบเดียวกันครับ


หน้า: 1 2 [3] 4 5