อยากเรียนถามถึงการเรียก form โดยใช้ wherecondition เป็นตัว filter
กระทู้เก่าบอร์ด อ.สุภาพ ไชยา

 251   2
URL.หัวข้อ / URL
อยากเรียนถามถึงการเรียก form โดยใช้ wherecondition เป็นตัว filter

อยากเรียกอีก form "expense_tran2" บน listbox  โดยใช้ codeนี้ แต่ขึ้นมาเฉพาะ form เปล่า 
Private Sub expenselist_DblClick(Cancel As Integer) 
 Dim strWhere As String, varItem As Variant, gstrWhere As String 
    If Me!expenselist.ItemsSelected.Count = 0 Then Exit Sub 
      For Each varItem In Me!expenselist.ItemsSelected 
             strWhere = Me!expenselist.Column(0, varItem) 
    Next varItem 
strWhere = Left$(strWhere, Len(strWhere) - 1) 
    gstrWhere = "no = '&strWhere&'" 
DoCmd.OpenForm FormName:="expense_tran2", wherecondition:=gstrWhere 
     
   End Sub 
 code นี้ สามารถเปิด form"expense_tran2" แต่ไม่สามารถเรียก record บน listbox  
ไม่ทราบว่า code ผิดหรือเปล่า แล้ว  form"expense_tran2"  ที่เราจะเรียกต้องใส่ code ด้วยหรือเปล่าครับ......

2 Reply in this Topic. Dispaly 1 pages and you are on page number 1

1 @R01682
ให้เปลี่ยนจาก strWhere = Left$(strWhere, Len(strWhere) - 1) gstrWhere = "no = '&strWhere&'" เป็น strWhere = Left$(strWhere, Len(strWhere) - 1) gstrWhere = "no = '" &strWhere & "'" ครับ
2 @R01697
¢Íº¤Ø³¤ÃѺ
@ ประกาศใช้งานเว็บบอร์ดใหม่ => บอร์ดเรียนรู้ Access สำหรับคนไทย
แล้วจะใส่ลิ้งอ้างอิงมาที่โพสต์เก่านี้หรือไม่ก็ตามสะดวกครับ
Time: 0.0833s