กระทู้เก่าบอร์ด อ.สุภาพ ไชยา
        
           501   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
    
    
  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 
				
        
    2 @R02101    
        
  
      ขอบคุณครับ    
    
  
        
    3 @R02116    
        
    
      n = Integer  แต่  Right(MaxValue,  7)  จะได้ผลลัพท์เป็นชนิด string  ไม่ทราบผมเข้าใจถูกปล่าว?    
    
  
      Time: 0.0551s
    
      
		
ให้เปลี่ยนเป็น Long แทน
Dim n As Long