Pedro Pinto
New member
- Local time
- Today, 12:14
- Joined
- Sep 20, 2006
- Messages
- 4
I'm dealling with a problem on positioning a form record by seeking a date primary field.
I have simple table with two data fields:
1st field- date as short-date (table primary field)
2nd field - description as text
Every time i use the method me.recordsetclone.findfirst to match a record by date, if the search date starts with a zero (i.e 02-09-2006) it gives me nomatch but the record exists! If the date doesn't start with zero (i.e 20-09-2006) it matches the record.
How is this possible? Am i doing something wrong? Is there a way to resolve this?
I retreive the search date by clicking on a listbox with the dates records of the table "MyDates"
The code i use is this:
Private Sub List0_Click()
With Me
.RecordsetClone.FindFirst "[MyDates] = #" & me.list0 & "#"
If Not .RecordsetClone.NoMatch Then
.Bookmark = .RecordsetClone.Bookmark
.Recordset.Bookmark = .RecordsetClone.Bookmark
Else
MsgBox ("Record not found")
End If
End With
End Sub
Thank you.
Note: i've tried "dlookup" method and it gives me the same results.
I have simple table with two data fields:
1st field- date as short-date (table primary field)
2nd field - description as text
Every time i use the method me.recordsetclone.findfirst to match a record by date, if the search date starts with a zero (i.e 02-09-2006) it gives me nomatch but the record exists! If the date doesn't start with zero (i.e 20-09-2006) it matches the record.
How is this possible? Am i doing something wrong? Is there a way to resolve this?
I retreive the search date by clicking on a listbox with the dates records of the table "MyDates"
The code i use is this:
Private Sub List0_Click()
With Me
.RecordsetClone.FindFirst "[MyDates] = #" & me.list0 & "#"
If Not .RecordsetClone.NoMatch Then
.Bookmark = .RecordsetClone.Bookmark
.Recordset.Bookmark = .RecordsetClone.Bookmark
Else
MsgBox ("Record not found")
End If
End With
End Sub
Thank you.
Note: i've tried "dlookup" method and it gives me the same results.