I have a weird problem, and I cannot work out what's going on.
I have a continuous form (frmEnterCosts) based on a query (qryEnterCosts). I have series of unbound combo boxes to filter various fields on this form, one of which (cboFilterPackingDate) filters the field 'PackingDate', which is a Date field.
There is a command button which takes the contents of each combo box to build the filter string and then applies the filter when it is pressed.
The piece of code within the OnClick event concerning the PackingDate is:
Expand|Select|Wrap|Line Numbers
- If Not Me.cboFilterPackingDate.ListIndex = -1 Then
- strPackingDate = "[PackingDate] = #" & Me.cboFilterPackingDate & "#" & " AND"
- Else
- strPackingDate = ""
- End If
I have put the filter string into a text box to see what's happening, and the filter string has the correct date (i.e. matches the combo box) it just filters the wrong date, and I cannot for the life of me figure out where its going wrong. There is nowhere in the database where the date is stored in the U.S format.
I've used Format in the code to try and force it, but I don't think this is the problem.
I would be grateful for any pointers as it's driving me a bit mad!
Thanks
Neil