Results 1 to 3 of 3

Thread: Access and Fields of Recordsets using DAO3.6 [Resolved]

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2002
    Posts
    62

    Resolved Access and Fields of Recordsets using DAO3.6 [Resolved]

    Hi,

    I'm having a problem retrieving fields from a recordset when using SQL in access. My code is this

    Code:
    varSQL = "SELECT * FROM tblemployees"
    Set db = CurrentDb
      Set rs = db.OpenRecordset(varSQL, dbOpenDynaset, dbReadOnly)
    rs.MoveFirst
    Do While Not rs.EOF
    MsgBox rs.Fields("lastcontactdate")
    If rs.Fields("lastcontactdate") < varCompareDate Then
    varcount = varcount + 1
    rs.MoveNext
    Else
    rs.MoveNext
    End If
    Loop
    the rs.fields("lastcontactdate") line always seems to bring up an error "Item not found in this collection". Any thoughts on a speedy resolution?
    Last edited by Zukovsky; May 26th, 2005 at 07:56 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width