I have a form where the user can select the Year for something and I want that Year to be used in a SQL statement. Like so:
The combo box (cboYear) is 'Unbound', I've manually entered the values. There is only one column of values, example: 03/04, 04/05, 05/06, etc..
The SQL statement works if I take out the 'AND' part but if I put it in, then I get no returned records. I've tried cboYear.Column(1) and Column(0). I've even hardcoded the year at the end of the statement to look like:
with no records returned.
And yes, I have checked to make sure there is data meeting the criteria.
Code:
strSQL = strSQL + " WHERE ((" & tblEmployees & ".EmployeeID = " & tblQuarterlyInformation & ".EmployeeID)" & _
" AND (" & tblQuarterlyInformation & ".Year = " & cboYear.Value & "))"
The combo box (cboYear) is 'Unbound', I've manually entered the values. There is only one column of values, example: 03/04, 04/05, 05/06, etc..
The SQL statement works if I take out the 'AND' part but if I put it in, then I get no returned records. I've tried cboYear.Column(1) and Column(0). I've even hardcoded the year at the end of the statement to look like:
Code:
strSQL = strSQL + " WHERE ((" & tblEmployees & ".EmployeeID = " & tblQuarterlyInformation & ".EmployeeID)" & _
" AND (" & tblQuarterlyInformation & ".Year = 03/04))"
And yes, I have checked to make sure there is data meeting the criteria.