Patrick O'Dea
asked on
My Dlookup is returning a string (I want a number)
See
Expr1: DLookUp("(AllowanceAMount) ","tblAllo wances","A llowanceID =1")
This returns the correct value BUT as a string...
I want [AllowanceAmount] returned as a number (which is how it is held on tblAllowances).
What should I do?
Expr1: DLookUp("(AllowanceAMount)
This returns the correct value BUT as a string...
I want [AllowanceAmount] returned as a number (which is how it is held on tblAllowances).
What should I do?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If you are using this DLookup() in a query, then you should change your method to use an outer join (left) to tblAllowances instead. This will return the data you want with far less overhead and will not change the data type.
the DLookup() runs a SEPARATE query for EVERY row you select. So, if you select 100 rows, you are running 101 queries. If you select a thousand rows, you are running 1,001 queries.
NEVER, use domain functions in queries (or code loops) unless there is no alternative and except in rare cases, there is always an alternative.
the DLookup() runs a SEPARATE query for EVERY row you select. So, if you select 100 rows, you are running 101 queries. If you select a thousand rows, you are running 1,001 queries.
NEVER, use domain functions in queries (or code loops) unless there is no alternative and except in rare cases, there is always an alternative.
ASKER
Thanks Pat,
Your words of caution are appreciated ....
I will re-engineer the query (without the Dlookup)
Many thanks once again.
Your words of caution are appreciated ....
I will re-engineer the query (without the Dlookup)
Many thanks once again.
ASKER
I just learnt something!