DLookUp problem (1 Viewer)

radek225

Registered User.
Local time
Yesterday, 22:11
Joined
Apr 4, 2013
Messages
307
I want to see if there is some kind of record in "technologia" field in table "tblDolZlecenia" where "technologia" = 1 and where tblDolZlecenia.id_zlecenia = forms!frmZlecenieMarzena!id_zlecenia (id_zlecenia is a text field)
So I built DLookUp, the problem is, that two criteria won't work together but separately working good.
Code:
Nz(DLookup("[technologia]", "tblDolZlecenia", "[Id_zlecenia]='" & Forms![frmZlecenieMarzena]![ID_Zlecenia] & "'" And "[technologia] = 1"), 0)
Does anyone know why is that?
 

pr2-eugin

Super Moderator
Local time
Today, 06:11
Joined
Nov 30, 2011
Messages
8,494
Try this..
Code:
Nz(DLookup("[technologia]", "tblDolZlecenia", _
     "[Id_zlecenia]='" & Forms![frmZlecenieMarzena]![ID_Zlecenia] & "' And [technologia] = 1"), 0)
When Concatenation conditions, take a careful look !
 

radek225

Registered User.
Local time
Yesterday, 22:11
Joined
Apr 4, 2013
Messages
307
Working gooooooood, thx:D
 

SmallTime

Registered User.
Local time
Yesterday, 22:11
Joined
Mar 24, 2011
Messages
246
or even

Nz(DLookup("[technologia]", "tblDolZlecenia", "[Id_zlecenia]=" & Forms![frmZlecenieMarzena]![ID_Zlecenia] & " And [technologia] = 1"), 0)
 

pr2-eugin

Super Moderator
Local time
Today, 06:11
Joined
Nov 30, 2011
Messages
8,494
or even

Nz(DLookup("[technologia]", "tblDolZlecenia", "[Id_zlecenia]=" & Forms![frmZlecenieMarzena]![ID_Zlecenia] & " And [technologia] = 1"), 0)
SmallTime, you missed a 'Small' detail the OP mentioned that the Id_zlecenia is a Text field !
 

SmallTime

Registered User.
Local time
Yesterday, 22:11
Joined
Mar 24, 2011
Messages
246
Nice Spot, I'm gonna give you a thumbs up too
 

Users who are viewing this thread

Top Bottom