397
ห้อง MS Access / : พิมพ์ข้อความในคอมโบบ๊อกซ์ แล้วไม่ไล่ตัวอักษร
« เมื่อ: 20 ก.ค. 61 , 07:21:45 »
น่าจะเพราะ AutoExpand property ไม่ได้กำหนดเป็น Yes ครับ
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.
Private Function NewSalesPrice(Price As Variant, Percent As Variant) As Single
Dim Factor As Single
On Error GoTo ErrHandler
10 Factor = 1 + Percent / 100
20 NewSalesPrice = Price * Factor
ExitRtn:
30 Exit Function
ErrHandler:
40 MsgBox "In [NewSalesPrice], Line " & Str(Erl) & ", Error " & Str(Err.Number) & " : " & Err.Description
50 Resume ExitRtn
End Function
Dim xlApp As Object
Dim xlWorkbook As Object
Dim xlSheet As Object
DoCmd.TransferSpreadsheet acExport, , "ชื่อคิวรี่", "พาธ\ไฟล์.xls หรือ .xlsx", True
Set xlApp = CreateObject("excel.application")
Set xlWorkbook = xlApp.Workbooks.Open("พาธ\ไฟล์.xls หรือ .xlsx")
Set xlSheet = xlWorkbook.activesheet
With xlSheet.range("A1")
.entirerow.insert -4121 ' Insert and Shift Row Down
.entirerow.insert -4121 ' Insert and Shift Row Down
xlApp.DisplayAlerts = False
xlSheet.range("A1:E2").merge ' Merge Cells
xlApp.DisplayAlerts = True
End With
With xlSheet.range("A1")
.Value = "ชื่อหัวเรื่อง"
.Font.Name = "Tahoma"
.Font.Size = 18
.Font.Bold = True
.HorizontalAlignment = -4108 ' Align Center
End With
ผมลองสร้างเทเบิลและมี hyperlink field ผมใส่ค่าเป็น www.yahoo.com ผ่านเทเบิลโดยตรง เวลา export ไป Excel แล้วเปิดมาดู จะได้ข้อมูลเป็น 'www.yahoo.com#http://www.yahoo.com# หลังจากนั้นผมใส่ 'www.google.com ในบรรทัดต่อไปของ Excel เดียวกันนี้ แล้ว import เข้ามาในเทเบิลใหม่ ปรากฏว่า www.google.com จะไม่สามารถคลิกแล้วเปิดลิงค์ได้เช่นกัน จึงเข้าใจว่ารูปแบบที่ถูกต้องคงจะเป็น 'ข้อความที่ปรากฏ#ลิงค์ที่ต้องการไป# มากกว่าใส่ลิงค์เฉยๆใน Excel ครับ
ปักครับ
ผมเป็นบ่อยมาก ทุกวันนี้ยังเป็นอยู่บ่อย ๆ
แก้ทุกวิธีที่รู้แล้ว ยังไม่หาย
ถ้า จขกท ทำวิธีใดแล้วหาย รบกวนบอกหน่อยนะครับ
ขอบคุณครับ