What is the fastest way to verify a record exists?

  • Thread starter Thread starter WSF
  • Start date Start date
W

WSF

Access97
I have a data table (linked to the Front end mdb) where each record has a
unique job number [JobNo] field (indexed) in the table [tblJobData]. It
currently has approx 300k records.

From the Front End what is the fastest way to verify a particular job number
exists - I do not need to extract data, just verify the job number actually
exists. I am presently using DCount. Is there a better way?

TIA

WSF
 
WSF said:
Access97
I have a data table (linked to the Front end mdb) where each record has a
unique job number [JobNo] field (indexed) in the table [tblJobData]. It
currently has approx 300k records.

From the Front End what is the fastest way to verify a particular job number
exists - I do not need to extract data, just verify the job number actually
exists. I am presently using DCount. Is there a better way?
Almost anything is faster than dWhatEver. dLookup should be faster than
count since it can stop when it gets a hit

The Much faster way is to Open a recordset based on a query with the job
number as the criteria.
Then see if it is empty.
 
If you are doing this for only one record at any one time, DLookup() will be
fine.

If DLookup() is too slow, there is replacement at:
http://allenbrowne.com/ser-42.html
but it is typically only about twice the speed.

If you need this for every row of a query, a join or subquery will be much
better.
 
Back
Top