It's me again, with what should be a simple problem. Using the following code, I'm trying to compare a drop down combobox value list (January, February, etc...) with a date in the database ( 1/24/2011 for example). The records that meet the requirements are then listed in a listbox, by case number, which is also derrived from the database.
The code is as follows;
I'm pretty sure there is a small error here - perhaps something I'm overlooking. Any help would be greatly appreciated.
The code is as follows;
Code:
Dim montha As String
Dim strSQLa As String
Dim i As Integer
ReDim Months(1 To 12)
ReDim Indexes(1 To 12)
Dim convert As String
montha = Text101
Months = Array("January", "February", "March", "April", "May", "June", "July", "August", "Sepember", "October", "November", "Decemebr")
Indexes = Array("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12")
For i = 0 To 11
If montha = Months(i) Then convert = Indexes(i)
Exit For
Next
strSQLa = "SELECT case FROM caselog WHERE DATEPART(month, caselog.dateR) = '" & convert & "';"
List110.RowSource = strSQLa
I'm pretty sure there is a small error here - perhaps something I'm overlooking. Any help would be greatly appreciated.