By inserting empty strings, as in: strPlatNo = "", the field is no longer Null. It is just an empty string.
In your subsequent searches, you can search for Null fields AND empty strings. That is what the old dude is suggesting. That would be AFTER you had already inserted an empty string.
If you want to prevent empty strings from being inserted, then you need to modify your code so that if the field was Null, then you didn't insert an empty string instead. You would have to modify your SQL INSERT string in order to do that. Like:
If all fields had values:
strSQL = "INSERT INTO T_Survey(WOID,RecordingNo,PlatNo,Qtr) " & " VALUES ('" & strWOID & "', '" & strRecordingNo & "', '" & strPlatNo & "', '" & strQtr & "')"
If PlatNo did not have a value:
strSQL = "INSERT INTO T_Survey(WOID,RecordingNo,Qtr) " & " VALUES ('" & strWOID & "', '" & strRecordingNo & "', '" & strQtr & "')"
Is that the sort of thing you want to do dynamically? Or do you just want to change the search parameters to include empty strings AND Nulls?
mmcdonal
Look it up at:
http://wrox.books24x7.com