Overflow Error

  • Thread starter Thread starter Tamer Seoud
  • Start date Start date
T

Tamer Seoud

I have an Access2000 form that has several combo boxes.
The lost focus event of one of these combo boxes generates
the following error message: "Overflow".
The combo box gets its row source from the following SQL
Statement:
SELECT [tbl_LookUp_Expenses].[Expense Element Name] FROM
tbl_LookUp_Expenses;

And the lost focus event is as follows:

Private Sub cbo_ExpenseName_LostFocus()
On Error GoTo Err_cbo_ExpenseName_LostFocus

Dim ExpenseID As Integer
ExpenseID = DLookup("[Expense Element
ID]", "tbl_LookUp_Expenses", "[Expense Element Name]=Forms!
[frm_Accounts]![cbo_ExpenseName]")
cbo_ExpenseID = ExpenseID

Exit_cbo_ExpenseName_LostFocus:
Exit Sub

Err_cbo_ExpenseName_LostFocus:
MsgBox Err.Description
Resume Exit_cbo_ExpenseName_LostFocus
End Sub

Any idea why I'm getting the overflow error?

Thanks in advance
 
Thanks. How silly I am!!!


-----Original Message-----
Hi,
Try:
Dim ExpenseID As Long


--
HTH
Dan Artuso, Access MVP


"Tamer Seoud" <[email protected]> wrote
in message news:[email protected]...
I have an Access2000 form that has several combo boxes.
The lost focus event of one of these combo boxes generates
the following error message: "Overflow".
The combo box gets its row source from the following SQL
Statement:
SELECT [tbl_LookUp_Expenses].[Expense Element Name] FROM
tbl_LookUp_Expenses;

And the lost focus event is as follows:

Private Sub cbo_ExpenseName_LostFocus()
On Error GoTo Err_cbo_ExpenseName_LostFocus

Dim ExpenseID As Integer
ExpenseID = DLookup("[Expense Element
ID]", "tbl_LookUp_Expenses", "[Expense Element Name] =Forms!
[frm_Accounts]![cbo_ExpenseName]")
cbo_ExpenseID = ExpenseID

Exit_cbo_ExpenseName_LostFocus:
Exit Sub

Err_cbo_ExpenseName_LostFocus:
MsgBox Err.Description
Resume Exit_cbo_ExpenseName_LostFocus
End Sub

Any idea why I'm getting the overflow error?

Thanks in advance


.
 
Back
Top