I want to find out that, that fields [kolory p] and [kolory t] in my table are filled or not.
So I built the code:
Don't know why, but even if rst![kolory P] or rst![kolory t] are empty, "przod" and "tyl" are true
I've checked it, and ms access show me number 1 when fields are empty from expression Len(Nz(rst![Kolory P], 0)) or Len(Nz(rst![Kolory T], 0)). Why? There should be "0" and "false" in my code.
So I built the code:
Code:
Private Sub Naklad_skladki_AfterUpdate()
Dim rst As Recordset
Dim strSQL As String
Dim przod As Boolean
Dim tyl As Boolean
strSQL = "SELECT [tblGoraZleceniaNowa].[id_gora_zlecenia], [tblGoraZleceniaNowa].[kolory P], [tblGoraZleceniaNowa].[kolory T] FROM tblGoraZleceniaNowa where tblGoraZleceniaNowa.id_zlecenia=" & Me!ID_Zlecenia
Set rst = CurrentDb.OpenRecordset(strSQL)
Do While Not rst.EOF
If Len(Nz(rst![Kolory P], 0)) <> 0 Then
przod = True
End If
If Len(Nz(rst![Kolory T], 0)) <> 0 Then
tyl = True
End If
rst.MoveNext
Loop
rst.Close
MsgBox przod
MsgBox tyl
End Sub
Don't know why, but even if rst![kolory P] or rst![kolory t] are empty, "przod" and "tyl" are true
I've checked it, and ms access show me number 1 when fields are empty from expression Len(Nz(rst![Kolory P], 0)) or Len(Nz(rst![Kolory T], 0)). Why? There should be "0" and "false" in my code.