overFlow เกิดจากอะไรครับ
กระทู้เก่าบอร์ด อ.สุภาพ ไชยา

 249   3
URL.หัวข้อ / URL
overFlow เกิดจากอะไรครับ

overFlow เกิดจากอะไรครับ

Private Sub Form_Current()
Dim MaxValue As String
Dim n As Integer
MaxValue = DMax("BarCode", "Product")
If Me.NewRecord Then
n = Right(MaxValue, 7)
Me!BarCode = n + 1

End If

End Sub

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

1 @R02092
คิดว่า Integer ไม่พอสำหรับ n ครับ

ให้เปลี่ยนเป็น Long แทน

Dim n As Long

2 @R02101
ขอบคุณครับ
3 @R02116
n = Integer แต่ Right(MaxValue, 7) จะได้ผลลัพท์เป็นชนิด string ไม่ทราบผมเข้าใจถูกปล่าว?
@ ประกาศใช้งานเว็บบอร์ดใหม่ => บอร์ดเรียนรู้ Access สำหรับคนไทย
แล้วจะใส่ลิ้งอ้างอิงมาที่โพสต์เก่านี้หรือไม่ก็ตามสะดวกครับ
Time: 0.0407s