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