Why am I getting an overflow error in this simple query?

  • Thread starter Thread starter dgmoore
  • Start date Start date
D

dgmoore

I have a table with two long integer columns named ID and PARENT_ID. I
have a variable in my code currID (long). The statement

DLookup("PARENT_ID","table","ID =" & currID)

returns an error 6 Overflow for any value of currID (the IDs are
6-digit numbers, not nearly large enough to exceed the maximum value of
long integer). I tried opening a recordset on the table using the same
criteria and got the same overflow error there as well.

Does anybody have any suggestions?

Thanks
Dave
 
What are you doing with the DLookup? Are you assigning its value to a
variable? If so, how is the variable declared?
 
Try using brackets around PARENT_ID and ID

DLookup("[PARENT_ID]","table","[ID]=" & currID)
 
Back
Top