ChrisLeicester
Member
- Local time
- Today, 18:17
- Joined
- Feb 14, 2025
- Messages
- 64
Hi All
I have a simple continuous form that lists sales transactions with the following field, [SalesTransactionID], [TransactionDate], [CustomerName] and [TransTotal]
In the form header I have two unbound text boxes, [DatePicked] and [TranPicked] with a search button next to each box. The idea being the user can enter a date in the date box and the continuous form will filter to the records for that date, or filter for the transaction number in the other box. The transaction number box works perfectly and brings up the correct record. The datepicked box does nothing, it brings up no records at all. The transaction date field in the table is formatted as a short date, and so is the datepicked unbound text box, so it shouldnt be that.
I did think the issue might be that here in the uk our dates are dd/mm/yyyy and access may be looking for m/d/yyyy so I tried to format the me.datepicked but it is the same, all previous records disappear and not are shown.
What am I doing wrong, the similar code works for the other box that is a number and not the date,
thanks
I have a simple continuous form that lists sales transactions with the following field, [SalesTransactionID], [TransactionDate], [CustomerName] and [TransTotal]
In the form header I have two unbound text boxes, [DatePicked] and [TranPicked] with a search button next to each box. The idea being the user can enter a date in the date box and the continuous form will filter to the records for that date, or filter for the transaction number in the other box. The transaction number box works perfectly and brings up the correct record. The datepicked box does nothing, it brings up no records at all. The transaction date field in the table is formatted as a short date, and so is the datepicked unbound text box, so it shouldnt be that.
Code:
Dim strSQL As String
strSQL = "TransactionDate = " & Format(Me.DatePicked, "m/d/yyyy")
Me.Filter = strSQL
Me.FilterOn = True
I did think the issue might be that here in the uk our dates are dd/mm/yyyy and access may be looking for m/d/yyyy so I tried to format the me.datepicked but it is the same, all previous records disappear and not are shown.
What am I doing wrong, the similar code works for the other box that is a number and not the date,
thanks