Not certain if this is exactly what you want to do, but...
VB Code:
  1. 'Assuming some data input loop
  2.  
  3. Do While blnCondition
  4.  
  5.     'Do something
  6.  
  7.     intCount = intCount + 1
  8.     If intCount = 45000 Then Err.Raise 6
  9.  
  10. Loop
This will raise the Overflow error on the occurrance of the 45,000th input entry.