Reputation: 19
I am using a filter criteria to pull records where my table shows dynamic search results based on the input text. below is the code I am using -
Me.Bookbindingsource.Filter = *Book_Author LIKE '*" & TextBox.Text & "*'"
This field can be blank. When form loads, I want it to display all the records, but only those records are displayed which have atleast one character in the Author field.
Upvotes: 0
Views: 707
Reputation: 8859
Add where clause
where Book_Author LIKE '*" & TextBox.Text & "*' or Book_Author = ''
and if you have already other where clause then add
AND ( Book_Author LIKE '*" & TextBox.Text & "*' or Book_Author = '')
Upvotes: 0
Reputation: 93734
Try this where
clause. Use OR
condition to accept the empty string
where (Book_Author LIKE '*" & TextBox.Text & "*' or Book_Author = '')
Upvotes: 1