Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DLookup command Is this code correct?

Status
Not open for further replies.

Sillygirl

Programmer
May 3, 2002
80
US
I'm trying to determine that a record on a form is in a another table. However when I run a command, I know that the record is not in the table, the msgbox says it exists. My question is - 1. Is this code correct for the DLookup, can you check more than one value for a record?

Criteria = "[tblEx2MFRAME]![GMIN] = '" & Forms![frmP6abViewActive]![subfrmP6ABViewActive].Form![GMIN] & "' AND [tblEx2Mframe]![APPL_DATE] = " & Forms![frmP6abViewActive].Form![txtFormatAPPDATE] & ""

If IsNull(DLookup("GMIN", "tblEx2MFrame", [Criteria])) Then
MsgBox ("exist")

Else
MsgBox ("Does not Exist")

End If

Thanks!
[ponytails]
 
You seem to have that the wrong way round.

[tt]If IsNull(<..>)
'Does NOT exist[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top