Problem with Dlookup with 2 criteria

S

SF

Hi,

I am trying to get the Document path from a table through Dlookup. Dlookup
always return null


On Error GoTo Err_btnPrintProject_Click:
Dim DocPath As String

DocPath = DLookup("DocLink", "tblDocuments", "[DocCategory]='Application'
and [DocObjectID]=" & Me.ID)
MsgBox DocPath

Exit_btnPrintProject_Click:
DoCmd.Hourglass False
Exit Sub

Err_btnPrintProject_Click:
If Err.Number = 94 Then
MsgBox "File not found or link has not been set", vbOKOnly +
vbInformation
Else
MsgBox Err.Number, vbOKOnly + vbInformation
End If
Resume Exit_btnPrintProject_Click:

SF
 
D

Douglas J. Steele

Are you sure Me.ID is returning the correct value? Are you sure that
DocCategory really contains Application? (The reason I'm asking the latter
is because if you used the Lookup Wizard with DocCategory, it doesn't
actually contain what appears when you qiuery it)
 

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


Top