Results 1 to 4 of 4
  1. #1
    CabbyL is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Aug 2017
    Posts
    2

    Recordset FindFirst problems Err:3070

    Could someone look over my code. Err:3070 - states "...does not recognize rsItems.Item_ID". I have also used rsItems!Item_ID with similar results. Err:3070 - states "...does not recognize rsItems!Item_ID".



    Private Sub cboStore_AfterUpdate()
    On Error GoTo Err_LogError
    Dim db As Database
    Dim rsStoreSales As DAO.Recordset
    Dim rsItems As DAO.Recordset
    Dim sqlStoreSales As String
    Dim sqlItems As String

    sqlStoreSales = "SELECT qryOnSale.OnSale_ID, qryOnSale.WE_Special, qryOnSale.OnSale, qryOnSale.ItemID, qryOnSale.StoreID " & _
    "FROM qryOnSale WHERE (qryOnSale.StoreID) = " & Me!cboStore
    sqlItems = "SELECT qryItems.Item_ID, qryItems.Item, qryItems.DeptID, qryItems.Need, qryItems.WE_Special, qryItems.OnSale, " & _
    "qryItems.Keyword, qryItems.Alert_URL FROM qryItems"



    'My own standard loop looks something like this:
    Set db = CurrentDb
    Set rsStoreSales = db.OpenRecordset(sqlStoreSales, dbOpenDynaset)
    Set rsItems = db.OpenRecordset(sqlItems, dbOpenDynaset)

    'Check to see if the recordset actually contains rows
    If Not (rsStoreSales.EOF And rsStoreSales.BOF) Then
    rsStoreSales.MoveLast 'Unnecessary unless you want an accurate RecordCount
    rsStoreSales.MoveFirst 'Unnecessary in this case, but still a good habit
    gitest1 = rsStoreSales.RecordCount 'count is correct
    Do Until rsStoreSales.EOF = True

    rsItems.FindFirst "rsItems!Item_ID = " & rsStoreSales!ItemID

    .....

  2. #2
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Well, the obvious question is: "Does the query qryItems have a field 'Item_ID'"? Or is it "ItemID" (no underscore)?
    Don't see anything overtly wrong.....

    What is the SQL for the two queries "rsStoreSales" and "rsItems"?

    Or you could post your dB for analysis.....



    EDIT: Try
    Code:
    rsItems.FindFirst "Item_ID = " & rsStoreSales!ItemID
    Inside the record set "rsItems" is (should be) a field named "Item_ID", not "rsItems!Item_ID".

  3. #3
    CabbyL is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Aug 2017
    Posts
    2
    That did the trick. Thank-you.

  4. #4
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Glad to help..

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Recordset FindFirst
    By Praveenevg in forum Access
    Replies: 1
    Last Post: 08-18-2014, 12:55 PM
  2. Replies: 4
    Last Post: 12-09-2013, 01:27 PM
  3. recordset .findfirst question
    By RonL in forum Programming
    Replies: 4
    Last Post: 06-22-2013, 01:12 PM
  4. Recordset FindFirst Not Working
    By ShoresJohn in forum Programming
    Replies: 5
    Last Post: 03-01-2012, 06:59 PM
  5. Recordset Findfirst Problem
    By ColPat in forum Programming
    Replies: 6
    Last Post: 07-22-2010, 04:34 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
  •  
Other Forums: Microsoft Office Forums