Solved Overflow error in Elookup (1 Viewer)

Kayleigh

Member
Local time
Today, 13:04
Joined
Sep 24, 2020
Messages
708
Hi,
Wonder if anyone came across this issue: I have the following code on the current event
Me.txtConversionWk = Nz(ELookup("cfCnvrsnRate", "qryRtlConversionWk"), 0)
When I run the form and the textbox results to zero (as no results in the query), an error occurs. Any way to resolve this?
 

Attachments

  • elookup error.PNG
    elookup error.PNG
    4.7 KB · Views: 104

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 20:04
Joined
May 7, 2009
Messages
19,246
no idea but you can put a Breakpoint on the function and step through the code
to find out which record did it fault. then inspect the field of the query of that record.
 

isladogs

MVP / VIP
Local time
Today, 13:04
Joined
Jan 14, 2017
Messages
18,258
Just to check, you did mean Allen Browne's extended lookup Microsoft Access tips: Extended DLookup() (allenbrowne.com) and not the standard DLookup?
An overflow error normally occurs with a number field where the data is too large for the datatype. Try using e.g. Long integer instead of Integer
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 20:04
Joined
May 7, 2009
Messages
19,246
I tested my table has a Single field type.
create a form and assign a large double value to the field. ==> no error, just truncated value.

change the field to integer. and assign very large long value (and large double value). the same error,
but no overflow error.

for all we know the textbox can be unbound? now where can we declare it as Long/double?
ERR.png
 

isladogs

MVP / VIP
Local time
Today, 13:04
Joined
Jan 14, 2017
Messages
18,258
I have had overflow errors in integer fields in the past which is the reason I mentioned it as an possibility
Yes - it could indeed be an unbound textbox
 

missinglinq

AWF VIP
Local time
Today, 08:04
Joined
Jun 20, 2003
Messages
6,420
How could it possibly be Unbound and still cause an Overflow Error? Overflow of what?

Linq ;0)>
 

Kayleigh

Member
Local time
Today, 13:04
Joined
Sep 24, 2020
Messages
708
It is an unbound textbox - formatted as percentage. Not sure how this can be changed to long?
 

Users who are viewing this thread

Top Bottom