Hi there,
I've been working on this simple DB for two weeks, but it's still far from completion.
I had never done anything with Access+VBA+SQL before, so I'm wondering if anyone can help.
This database stores the information of the 15 type of documents (i.e. Voucher, Invoice...), and provides a search form for the user to search for the CD Name of certain document with different criteria.
These are the problems I encountered:
1) Don't know how to compare a texbox value with a date from a table
strSQL = "SELECT * " & _
"FROM tblDocuments " & _
"WHERE tblDocuments.[DocRefNum] ='" & refEntry.Value & "' " & _
"AND tblDocuments.[DocDate] = '" & dateEntry.Value & "';"
(refEntry & dateEntry are text boxes for users to type in values)
2) I have a subform to display the results, but it never displays anything (I put these two lines below the above SQL statement):
3) I don't know much about Queries, and I just followed other people's sample code and added one query to my DB. However, it seems that it doesn't do much there. What kind of queries should I add to my DB in order to have the search form work?
I'm really hoping that you can kindly take a look at my DB (unfortunately, my file size is a bit too big, 140kb), and give me some guidence. I'm really stuck, and I don't know how to resolve my problems.
I really appreciate your help..
Gratefully.
I've been working on this simple DB for two weeks, but it's still far from completion.

This database stores the information of the 15 type of documents (i.e. Voucher, Invoice...), and provides a search form for the user to search for the CD Name of certain document with different criteria.
These are the problems I encountered:
1) Don't know how to compare a texbox value with a date from a table
strSQL = "SELECT * " & _
"FROM tblDocuments " & _
"WHERE tblDocuments.[DocRefNum] ='" & refEntry.Value & "' " & _
"AND tblDocuments.[DocDate] = '" & dateEntry.Value & "';"
(refEntry & dateEntry are text boxes for users to type in values)
2) I have a subform to display the results, but it never displays anything (I put these two lines below the above SQL statement):
Me.resultForm.Form.RecordSource = strSQL
Me.resultForm.Form.Requery
3) I don't know much about Queries, and I just followed other people's sample code and added one query to my DB. However, it seems that it doesn't do much there. What kind of queries should I add to my DB in order to have the search form work?
I'm really hoping that you can kindly take a look at my DB (unfortunately, my file size is a bit too big, 140kb), and give me some guidence. I'm really stuck, and I don't know how to resolve my problems.
I really appreciate your help..
Gratefully.