FindFirst and Date Fields

M

Miles

I have an unbound combo box that I use to look up records. Here is the code
that I have in the AfterUpdate event for the combo box:

Dim rsTemp as DAO.Recordset
Set rsTemp = Me.RecordsetClone

Dim strSQLFindPerson as String
Let strSQLFindPerson = "[PersonRecordDateCreatedID] = #" &
Me.cboIndividual.Column(1) & "#"
Debug.Print strSQLFindPerson
rsTemp.FindFirst strSQLFindPerson

The problem is that I get no record found even though the Debug.Print shows
the time and date stamp that matches the information that I have in the
underlying table (the recordset is built from a query).

What am I doing wrong?

Thanks in advance.
Miles.
 
D

Damian S

Hi Miles,

Try:

Me.RecordsetClone.FindFirst strSQLFindPerson
Me.Recordset.Bookmark = Me.RecordsetClone.Bookmark


Damian.
 
M

Miles

Thanks Damian.

I couldn't get your suggestion to work. I tried the same approach (using
DAO) in my original post but using an integer field and it worked fine.
There seems to be something wrong with the date field, but I don't know what
it could be. Any ideas?

Thanks.
Miles.

Damian S said:
Hi Miles,

Try:

Me.RecordsetClone.FindFirst strSQLFindPerson
Me.Recordset.Bookmark = Me.RecordsetClone.Bookmark


Damian.

Miles said:
I have an unbound combo box that I use to look up records. Here is the code
that I have in the AfterUpdate event for the combo box:

Dim rsTemp as DAO.Recordset
Set rsTemp = Me.RecordsetClone

Dim strSQLFindPerson as String
Let strSQLFindPerson = "[PersonRecordDateCreatedID] = #" &
Me.cboIndividual.Column(1) & "#"
Debug.Print strSQLFindPerson
rsTemp.FindFirst strSQLFindPerson

The problem is that I get no record found even though the Debug.Print shows
the time and date stamp that matches the information that I have in the
underlying table (the recordset is built from a query).

What am I doing wrong?

Thanks in advance.
Miles.
 
Top