PDA

View Full Version : Dlookup Vs. IIF



dicepackage
03-24-2011, 06:01 AM
I have a function that runs and updates my database by importing e-mail information into Outlook. I currently have a Yes/No field in the database called "lock" that I check once the query has been run so it is not repeating multiple times. I will be doing this multiple times and have noticed it can really bog things down when scanning the folder.

When updating the database I am currently using a Dlookup to check if the field lock is checked. If it is False it will run a query that imports about five fields into my database. I am wondering would it perhaps be any faster to just eliminate the Dlookup statement in favor of an IIF statement to check for the lock field's status.

OBP
03-24-2011, 06:07 AM
Can't you add the Lock field to the query and set the Criteria to 0

dicepackage
03-24-2011, 06:09 AM
Well that is kind of what it is doing but at some point I need to check whether it is 0 or 1. The real slowdown is it just checking for this.

OBP
03-24-2011, 07:41 AM
But is the Lock field part of the Query's fields, if it is you only need to put a 0 in the first Criteria row and it will only allow records that are not locked.

dicepackage
03-24-2011, 07:43 AM
No, my lookup is searching a table for ID and then checking for lock status.

OBP
03-24-2011, 09:22 AM
Can you post an example database in access 2000-2003 format?