If you are trying to do it this way, then is seems to me you are taking data from a query that has more than one table. Is that correct? For example, CustomerID and OrderDates? Where the same customer might have more than one order. If you are taking data from only one table, then the user should only ever need to select the RecordNumber.
If you are trying to get something like CustomerID and OrderDates, then the problem you are having is with the OrderDate field.
First, is the OrderDate field a Date/Time field, or is it a text field? If it is a text field, then:
Dim sDate As String
sDate = Me.scboEnteredDate
where = where & " AND [EnteredDate] = '" & sDate & "'"
If it is a Date/Time field then (assuming that there are two columns for the combo box, and it is binding to a PK, not the date field):
Dim dtDate As Date
dtDate = Me.scboEnteredDate.Column(1)
where = where & " AND [EnteredDate] = #" & sDate & "#"
At least note in your code that you have added an additional space to the closing # sign which will also mess things up. You have:
where = where & " AND [EnteredDate] = #" + Me![scboEnteredDate] + " #"
This should at least be:
where = where & " AND [EnteredDate] = #" + Me![scboEnteredDate] + "#"
Did that help?
mmcdonal
|