DLookup doesn' always find value of new record

R

Rance R.

I am writing a new record to a table. Immediately after
the .AddNew and .Update, I use DLookup to find the Primary
Key value that was assigned to the new record (AutoNumber
datatype).

The DLookup doesn't always find the value and returns a
Null, which causes errors in subsequent recordset
operations that are relying on that value. There doesn't
seem to be any pattern to when DLookup fails, but it
happens often enough that it would be a problem when this
project is released.

Questions: 1- Should I use another recordset to find this
value rather than using DLookup?

2- Are there known problems with DLookup and should I
avoid using it as much as possible?

Thanks for any help and advice,

Rance
 

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