![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi I have created a simple database to record daily events (events on a subform on the header record for the day). I have included an unbound combo control on the main form which is used to move to a particular date. I am using dd/mm/yyyy format for the dates and the date field is formatted as short date. However when a date is entered in the search which could feasibly be in mm/dd/yyyy format (eg 04/03/2010 for 4th March) it returns the record for 03/04/2010. In cases where this reversal would not make sense (eg 23/03/2010) it returns the correct date. What am I doing wrong? My code associated with the search is as follows: Private Sub cboMoveTo_AfterUpdate() Dim rs As DAO.Recordset If Not IsNull(Me.cboMoveTo) Then If Me.Dirty Then Me.Dirty = False End If Set rs = Me.RecordsetClone rs.FindFirst "[diarydate] = " & "#" & Me.cboMoveTo & "#" If rs.NoMatch Then MsgBox "Not Found" Else Me.Bookmark = rs.Bookmark End If Set rs = Nothing cboMoveTo = Null End If End Sub |
#3
| |||
| |||
|
|
I have created a simple database to record daily events (events on a subform on the header record for the day). I have included an unbound combo control on the main form which is used to move to a particular date. I am using dd/mm/yyyy format for the dates and the date field is formatted as short date. However when a date is entered in the search which could feasibly be in mm/dd/yyyy format (eg 04/03/2010 for 4th March) it returns the record for 03/04/2010. In cases where this reversal would not make sense (eg 23/03/2010) it returns the correct date. What am I doing wrong? My code associated with the search is as follows: Private Sub cboMoveTo_AfterUpdate() Dim rs As DAO.Recordset If Not IsNull(Me.cboMoveTo) Then If Me.Dirty Then Me.Dirty = False End If Set rs = Me.RecordsetClone rs.FindFirst "[diarydate] = " & "#" & Me.cboMoveTo & "#" |
![]() |
| Thread Tools | |
| Display Modes | |
| |