Error 3265 Item not found in this collection

dogdays

Active Member
Joined
Apr 28, 2008
Messages
434
Office Version
  1. 2007
I created a recordset using
Code:
SELECT * FROM tblHouseholds INNER JOIN tblTemplatePreviousDonorsJack ON tblHouseholds.nHouseholdNumber = tblTemplatePreviousDonorsJack.nHouseholdNumber
The query selected the correct number of rows, but when I try to access any of the fields from the recordset I get error 3265. This includes the field nHouseholdNumber.
Any thoughts?

tia Jack
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Is the select statement creating a recordset? If so are you then referencing field names from the recordset? If so then make sure the field names you are referencing actually exist.
 
Upvote 0
What code are you using to create the recordset? You could have an issue with the query name, or there could be a glitch elsewhere.

Denis
 
Upvote 0
Good morning Denis:
I solved the problem by specifying all the fields that I wanted retrieved.
householdRecSet is a DAO.Recordset
Code:
' create household select
    strHhldQuery = "SELECT "
    strHhldQuery = strHhldQuery & "tblHouseholds.nIdentity,tblHouseholds.nHouseholdNumber,tblHouseholds.nIndividualNumber,tblHouseholds.nCurrentStatus,"
    strHhldQuery = strHhldQuery & "tblHouseholds.tCurrentState,tblHouseholds.nReasonInactive,tblHouseholds.dtDateJoined,tblHouseholds.tInvoiceMonth,"
    strHhldQuery = strHhldQuery & "tblHouseholds.dtDateInactive,tblHouseholds.dtDateUpdated,tblHouseholds.dtExpirationDate,tblHouseholds.nRelationshipType,"
    strHhldQuery = strHhldQuery & "tblHouseholds.bDoNotMail,tblHouseholds.bDoNotCall,tblHouseholds.bDoNotSolicit,tblHouseholds.tAlternateMailingName,"
    strHhldQuery = strHhldQuery & "tblHouseholds.tAddressLine1,tblHouseholds.tAddressLine2,tblHouseholds.tAddressLine3,tblHouseholds.tCity,tblHouseholds.tState,tblHouseholds.tPostcode,"
    strHhldQuery = strHhldQuery & "tblHouseholds.tCountry,tblHouseholds.mComments,tblHouseholds.bSeasonalAddress,tblHouseholds.bBillingAddress"
    strHhldQuery = strHhldQuery & " FROM " & gcstrHouseholdsTableName
    strHhldQuery = strHhldQuery & " INNER JOIN " & gstrTempPreviousDonorsTableName
    strHhldQuery = strHhldQuery & " ON " & gcstrHouseholdsTableName & ".nHouseholdNumber" & " = "
    strHhldQuery = strHhldQuery & gstrTempPreviousDonorsTableName & ".nHouseholdNumber"
    Set householdsRecSet = DBEngine(0)(0).OpenRecordset(strHhldQuery)
It would have been much easier to use SELECT *.

Jack
 
Upvote 0

Forum statistics

Threads
1,224,587
Messages
6,179,740
Members
452,940
Latest member
rootytrip

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top