DLookup causes MSACCESS.EXE process to not close

L

Lloyd

I noticed that after adding the below code into one of my forms, that
MSACCESS.EXE process wont close any longer. I narrowed it down to the first
line of code listed below with the DLookup. Does anyone know why this would
be happening or what I need to do to fix it? The code is in the forms
current event.

thanks in advance

DateCk = Nz(DLookup("[DateReviewed]", "qryCaseReview", Me![DRNO]), "")

If DateCk = "" Then

'MsgBox "date is blank"

ElseIf Not IsNull(DateCk) Then

daysdiff = DateDiff("d", [DateCk], Date)

'MsgBox daysdiff

If daysdiff > 180 And Forms!frmcaseupdate.Dispo = "Open" Then
Forms!frmcaseupdate.Label128.Visible = True

Else

End If
 
D

Dorian

The last argument in your DLookup is invalid. It needs to be a condition.
E.g.
"Me!DRNO = 'something'"
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".
 
R

RonaldoOneNil

The third part of you Dlookup statement is the where part. You have just
specified a field. The Dlookup is get me a field from a table or query where
a field in the table or query matches something. Your statemnet should look
something like this

DateCk = Nz(DLookup("[DateReviewed]", "qryCaseReview", "[DRNo] = " &
Me![DRNO]), "")
 

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