D
Deleted member 73419
Guest
Hello guys,
What I want to do is build an SQL query from a form, but so far I am having problems where there is no data. Let me elaborate a little.
I have a form with three textboxes and I want to build an SQL query from the data within these textboxes. So far I have this:
The problem is that if I fill in the date and author fields the SQL query that is produced searches where the date is 'xyz' AND the author is 'AN Other' AND the description is blank. What I really need is to ignore the description if nothing is filled in and only search on the date and author fields.
Can anyone please advise where I am going wrong?
Thanks
What I want to do is build an SQL query from a form, but so far I am having problems where there is no data. Let me elaborate a little.
I have a form with three textboxes and I want to build an SQL query from the data within these textboxes. So far I have this:
Code:
str = "SELECT tblNumberData.EntryDate, tblNumberData.Author, tblNumberData.Description FROM tblData, tblNumberData WHERE (((tblNumberData.EntryDate) Like '" & txtEntryDate & "') AND ((tblNumberData.Author) Like '" & txtAuthor & "') AND ((tblNumberData.Description) Like '" & txtDescription & "'));"
Can anyone please advise where I am going wrong?
Thanks