What is the fastest way to verify a record exists?

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
 
M

Mike Painter

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.
 
A

Allen Browne

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top