This is exactly what I get with Debug.print.
VB Code:
SELECT * FROM tbltable1 WHERE tbltable1.[Field1] Is Null AND tbltable1.[Field2] ="D=8 L=30 U=37VAC R=160W";
Why can´t I use BOF and EOF whith the code? Now I always get True on both EOF and BOF.
VB Code:
If Len(Me![Text0]) > 0 Then Number1 = "='" & Me![Text0] & "'" Else Number1 = "Is Null" End If If Len(Me![Text1]) > 0 Then Number2 = "='" & Me![Text1] & "'" Else Number2 = "Is Null" End If SQL = "SELECT * FROM tbltable1 " SQLWhere = "WHERE tbltable1.[Field1] " & "" & Number1 & " " & _ "AND tbltable1.[Field2] " & "" & Number2 & ";" Set db = CurrentDb Set rs = db.OpenRecordset(SQL & SQLWhere) If rs.BOF = False And rs.EOF = False Then Msgbox "Test" End if




Reply With Quote