DLookUp problem

radek225

Registered User.
Local time
Yesterday, 22:07
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?
 
Try this..
Code:
Nz(DLookup("[technologia]", "tblDolZlecenia", _
     "[Id_zlecenia]='" & Forms![frmZlecenieMarzena]![ID_Zlecenia] & "' And [technologia] = 1"), 0)
When Concatenation conditions, take a careful look !
 
Working gooooooood, thx:D
 
or even

Nz(DLookup("[technologia]", "tblDolZlecenia", "[Id_zlecenia]=" & Forms![frmZlecenieMarzena]![ID_Zlecenia] & " And [technologia] = 1"), 0)
 
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 !
 

Users who are viewing this thread

Back
Top Bottom