dlookup

A

AccessMan

I am using two successive DLookUp statements against the same table with
different criteria after a form button is clicked. Sometimes, the second
statement generates an "invalid use of NULL" error, and I can't figure out
why. It is certainly not a data issue. Both calls involve valid criteria.
Has anybody run into a timing issue? Could the first DLookUp have not closed
down its access to the table before the second DLookUp starts? If I comment
out either one of the DLookUp statements the error does not arise.

Thanks!!!
 
M

Mike Painter

AccessMan said:
I am using two successive DLookUp statements against the same table
with different criteria after a form button is clicked. Sometimes,
the second statement generates an "invalid use of NULL" error, and I
can't figure out why. It is certainly not a data issue. Both calls
involve valid criteria. Has anybody run into a timing issue? Could
the first DLookUp have not closed down its access to the table before
the second DLookUp starts? If I comment out either one of the
DLookUp statements the error does not arise.

Thanks!!!

Try a Do Events between the two.
 
A

AccessMan

Mike - I'm not familiar with that statement, and help was not helpful. Could
I ask for the exact syntax please?
 
M

Mike Painter

AccessMan said:
Mike - I'm not familiar with that statement, and help was not
helpful. Could I ask for the exact syntax please?

It's all one word and it just lets the system catch up with things before
going on.
99.9% of teh time event driven ssoftware is a good thing but sometimes one
event will start before an earlier needed one gets finished.

some code ges here
DoEvents
some more code goes here
 

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

Similar Threads

DLookup 2
Using Max or DMax in DLookUp criteria? 1
Access ACCESS DLOOKUP INVALID USE OF NULL 0
DLookup criteria help 7
Dlookup in ControlSource 2
DLookup 4
Dlookup Trouble 3
Dlookup Question 2

Top