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

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
 
D

Douglas J. Steele

What are you doing with the DLookup? Are you assigning its value to a
variable? If so, how is the variable declared?
 
G

Guest

Try using brackets around PARENT_ID and ID

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top