[AccessD] Dlookups. your opinion please.

Steve Schapel miscellany at mvps.org
Mon Sep 22 23:19:22 CDT 2008


Darryl,

As far as I know, the only real criticism that can be levelled at 
DLookup (and the other domain aggregate functions) is that it can be a 
bit slow.  However, that would only be noticeable for example if it was 
being used in a calculated field in a query or some such, based on a 
table with a large number of records.  If you're talking about one-off 
use within VBA code, it sounds like you may have more pressing things to 
"fix".

Regards
Steve


Darryl Collins wrote:
> Hi All,
> 
> I have, ummm, inherited a database (SQL Server Back, Access Front) at work.  Frankly this thing is a disaster waiting to happen and since the guy who built has left (he used to admin it, and I suspect there were regular band aid repairs and updates to keep it all steady) the actual users are having no end of bother and bugs with it.  anyway, I digress...
> 
> The code is full of DLookups, something which I have not felt the need to use ever.  I think I read somewhere that using lots of dlookups is a bad idea.  Anyway. What is your opinion on using them?  If they are fine and no bother then I am happy to leave them in the code (at least for now).  But if they are known to be bothersome then I am more than happy to get rid of them and use something better.
> 
> this thing just gets more and more ugly.  Nearly everything in the VBA code is dimmed as a string and they are wondering why the numeric fields are not populating correctly.  messy messy messy.  I can see someone in the past has figured out that was a bad idea and redimmed some stuff as double. But they have left the code like this
> "Dim strMyVariable as Double" which is a right PITA when debugging. And the whole show is being driven client side from Access, rather than server side from SQL Server... Sorry about the rant...
> 



More information about the AccessD mailing list