แสดงกระทู้

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 - Krathok-man

หน้า: [1]
1
ห้อง MS Access / Invalid procedure call or argument
« เมื่อ: 10 ก.พ. 64 , 11:01:02 »

 Dim TextOUT  As Variant
 Dim NotpadDoc
Dim Myfso As New FileSystemObject
Set NotpadDoc = Myfso.CreateTextFile("D:\Report1.txt", True)

 Dim Rs   As DAO.Recordset
Set Rs = CurrentDb.OpenRecordset("select * from  report1 order by ida ")
If Rs.RecordCount > 0 Then
Do Until Rs.EOF

TextOUT = Trim(Rs("summary"))
NotpadDoc.Write TextOUT
NotpadDoc.Write Chr(13)

Rs.MoveNext
Loop


NotpadDoc.Close
Set Myfso = Nothing

    On Error Resume Next
    Shell "Notepad.exe " & "D:\Report1.txt", vbNormalFocus
    Dim oShell
Set oShell = CreateObject("WScript.Shell")
oShell.SendKeys "% x"

  End If

Rs.Close
Set Rs = Nothing


Code นี้มันทำงานได้  เมื่อ TextOUT  มีค่าไม่ยาว    แต่เมื่อมันมี  ข้อความยาวขึ้น   มันก็ฟ้อง  "Invalid procedure call or argument "    ผมไปไม่เป็นเลยครับ  ไม่มี idea  ว่าจะแก้อะไรดี   ขอความเห็นจากผุ้มีประสบการณ์ หน่อยครับ  ควรทำอย่างไร
โพสต์นี้ได้รับคำขอบคุณจาก: Jieng2021

2
ห้อง MS Access / : Window10+Access2003 Missing COMDLG32.OCX
« เมื่อ: 03 พ.ย. 63 , 15:58:26 »
ได้แล้วนะครับ  ขอบคุณพี่มาก  ตัวติดตั้ง  VisualBasic6-KB896559-v1-ENU
ไม่งั้นผมคง งม  อีกนาน  ขอบคุณครับ
โพสต์นี้ได้รับคำขอบคุณจาก: PNR

3
OK  ได้ Concept
พัฒนาต่อได้แล้วครับ
ขอบคุณครับ
โพสต์นี้ได้รับคำขอบคุณจาก: SakDa

หน้า: [1]