FindFirst and Date Fields

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
Hi Miles,

Try:

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


Damian.
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top