Have a question about a perplexing error message -
Upon clicking a selection in a combo box, approx. 1/4 of the time I get a "Error #: 6 Description: Overflow" message.
After clicking "OK" I try to repeat with the same selection, but then don't get the error message, but can get it,
sometimes, by selecting another CustomerNo. I put error handling in the Sub, but never see this message box.
It's frustrating because it's not repeatable; sometimes Cust #5 goes through, and sometimes not; same with all
Here's the code:
Private Sub Combo_AfterUpdate()
Dim rs As Object
On Error GoTo SubCombo_Err
Set rs = Me.Recordset.Clone ' set up record for bookmarking
rs.FindFirst "CustomerNo = " & Str(Nz(Me![Combo], 0)) ' look for the
' combo box selected customer
If DCount("CustomerNo", "CustList", "CustomerNo=" & _
Str(Nz(Me![Combo], 0))) > 0 Then ' is count of occurances > 0?
Me.Bookmark = rs.Bookmark ' yes, bookmark this
DoCmd.GoToRecord , , acNewRec ' no, start a new record
Me.CustomerNo = Str(Nz(Me![Combo], 0)) ' and show new Customer No
SubCombo_Exit: ' standard exit
MsgBox "Customer Database error: " & Err, vbCritical ' opps
CustomerNo is formated as long integer, and may get up to 10E7. Any idea why
I'm getting this message? I don't get my MsgBox popping up, and setting breakpts.
never catches this. Should I be specifying a range for the DCount (it's less than
255)? I suspect this is something obvious that a newbie, like me, wouldn't see.