Running Number Record
กระทู้เก่าบอร์ด อ.Yeadram

 907   1
URL.หัวข้อ / URL
Running Number Record

เรียน อ. ทุกท่านครับ

ปกติผมใช้ Module นี้ ใน Access 2007 ได้ แต่พอเปลี่ยนมาใช้ Access 2013
กลับมี Error ตรง Me (Me.RecordsetClone) ครับ
แก้ได้อย่างไรครับ

Public Function Rec1(a As Variant) As Variant
    Dim rst As DAO.Recordset
    Set rst = Me.RecordsetClone
If rst.RecordCount > 0 Then
rst.MoveLast
rst.MoveFirst
Else: Exit Function
End If
            Do Until rst.EOF
            If rst!ID = a Then
               Rec1 = rst.AbsolutePosition + 1
               Exit Function
              End If
            rst.MoveNext
            Loop
        rst.Close
        Set rst = Nothing
If Me.NewRecord Then GoTo Rec1_Exit
Rec1_Exit:
On Error Resume Next
rst.Close: Set rst = Nothing
Exit Function
End Function


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

1 @R20284
1. Compile หรือยัง ถ้ายัง ให้ทำก่อน
2. รู้ได้ยังไงว่ามี error บรรทัดนี้
3. error code และข้อความคืออะไร
@ ประกาศใช้งานเว็บบอร์ดใหม่ => บอร์ดเรียนรู้ Access สำหรับคนไทย
แล้วจะใส่ลิ้งอ้างอิงมาที่โพสต์เก่านี้หรือไม่ก็ตามสะดวกครับ
Time: 0.2684s