Allow me to explain my situation below:
I have 2 textboxes in vb6 namely txtStartDate and txtEndDate.
I want these textboxes to hold starting date and ending date values respectively as parameters in Access date range query. I have a problem in expressing these textbox parameters in SQL statement within VB6.
Here's what I have so far:
Private Sub Command1_Click() salesForm.Adodc1.RecordSource = "SELECT * FROM Sales_Table WHERE (Between (Date_Sold = '" & txtStartDate.Text & "') AND (Date_Sold = '" & txtEndDate.Text & "')) " salesForm.Adodc1.Refresh End Sub
I get this error message when running the code above:
Syntax Error(Missing Operator)in query expression
Obviously, it has something to do with my sql statement.
I would appreciate any help I could get.