แสดงกระทู้

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 - kitisak

หน้า: 1 ... 3 4 5 [6]
91
เป็นตัวอย่างของอ.สุภาพ เขียนไว้ โปรแกรม MS Access  เสียงเรียกคิว

https://drive.google.com/file/d/1HQuSBEj0aaePrM-jpw-f64rqXSctLwTf/view?usp=sharing

โพสต์นี้ได้รับคำขอบคุณจาก: kitisak

92
Private Sub SendMail_Click()
Dim App As New Outlook.Application
Dim Email As Outlook.MailItem
Dim fileName As String, today As String
today = Format(Date, "DDMMYYYY")
fileName = Application.CurrentProject.Path & "\Report1_" & today & ".pdf"
DoCmd.OutputTo acReport, "Report1", acFormatPDF, fileName, False

Set Email = App.CreateItem(olMailItem)
With Email
    .Recipients.Add "ใส่อีเมลผู้รับจดหมาย"
    .Subject = "ชื่อเรื่อง"
    .Body = "รายละเอียดเนื้อหา"
    .Attachments.Add fileName
    .Send
End With

MsgBox "ส่ง Email เสร็จแล้ว!", vbInformation, "EMAIL STATUS"

Set Email = Nothing
Set App = Nothing

End Sub
โพสต์นี้ได้รับคำขอบคุณจาก: kitisak

93
ห้อง MS Access / > เปลี่ยนแป้นภาษาด้วย VB
« เมื่อ: 26 มี.ค. 61 , 13:25:36 »
เมื่อกดเครื่องหมาย * ใน textbox1 แล้วให้แป้นพิมพ์เปลี่ยนเป็นภาษาอังกฤษ เราต้องเขียนโค๊ต อย่างไรครับ

สามารถทำได้ครับ กรณีที่เรากดปุ่ม * แล้วให้เปลี่ยนภาษาตามที่เรากำหนดไว้สามารถทำได้ดังนี้
ผมกำหนด textbox ชื่อ text1

คำสั่งบน Module

โค๊ด: [Select]
Private Declare PtrSafe Function ActivateKeyboardLayout Lib "user32.dll" (ByVal mylanguage As Long, Flag As Boolean) As Long
Private Const Eng = 1033 
Private Const Th = 1054
Sub keyEng()
Call ActivateKeyboardLayout(Eng, True)
End Sub
Sub KeyTh()
Call ActivateKeyboardLayout(Th, True)
End Sub

คำสั่ง Event ที่ Text1
โค๊ด: [Select]
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyMultiply Then
Call keyEng
End If
End Sub
ตัวอย่างการใช้งานด้านล่างครับ
โพสต์นี้ได้รับคำขอบคุณจาก: kitisak

94
ห้อง MS Access / > เปลี่ยนแป้นภาษาด้วย VB
« เมื่อ: 26 มี.ค. 61 , 10:13:02 »
> คีย์บอร์ดไม่มีปุ่มเปลี่ยนภาษาเหรอครับ
> ตั้งค่าให้เมื่อมาใช้ textbox1 ให้เปลี่ยนภาษาตั้งต้นเป็นภาษาอังกฤษได้ตามรูป (ถ้าจะพิมพ์ไทยก็กดปุ่มเปลี่ยนภาษา~)


> เขียนฟังก์ชั่นให้ "*" เป็นปุ่มเปลี่ยนภาษาแล้วให้ textbox1 เรียกใช้งานฟังก์ชั่นนั้นอีกที (ได้หรือไม่,ทำอย่างไรรอดูกันต่อไปครับ :smile:)
โพสต์นี้ได้รับคำขอบคุณจาก: kitisak

หน้า: 1 ... 3 4 5 [6]