Dlookup 2 criteria

Directlinq

Registered User.
Local time
Today, 05:16
Joined
Sep 13, 2009
Messages
67
How can i change this code so if a record in the table TblArtist has the artist string in the artist_name column and has artistid string in the artistid column of the same record it returns false?

Code:
If IsNull(DLookup("[artist_name]", "[TblArtist]", "[artist_name]=""" & artist & """")) = False Then

Many Thanks
 
How can i change this code so if a record in the table TblArtist has the artist string in the artist_name column and has artistid string in the artistid column of the same record it returns false?

Many Thanks

DLookup only returns one value. So if you are looking to get a second value, you will need to do a second DLookup. I would do a dlookup of the Primary key of both dlookups and if they match, then you can return false.


Code:
If DLookup("[ArtistID]", "[TblArtist]",  _
"[artist_name]=""" & artist & """") =  _
Dlookup("[ArtistID]","TblArtist", _
"[ArtistID]=" & artistid Then
 

Users who are viewing this thread

Back
Top Bottom