Hello all. I am getting an "Item Not Found in this Collection" error with the following code:
I know the SELECT statement works, as I've tried it in a query.
My suspicion is that I am not correctly using the syntax to refererence the fields in the other tables, in this line right here:
So, how does one call a field in a SELECT statement when there are two fields of the same name? Basically I'm looking for something like Table1.Field1
Any help?
Thanks! 
Code:
s = "SELECT Customers.*, SalesManagers.*, Children.*" & _
"FROM (Districts INNER JOIN (Routes INNER JOIN (Children INNER JOIN Customers ON Children.ChildID = Customers.ChildID) ON (Routes.RouteID = Customers.RouteID) AND (Routes.RouteID = Customers.RouteID)) ON Districts.DistrictID = Routes.DistrictID) INNER JOIN SalesManagers ON Districts.SalesManagerID = SalesManagers.SalesManagerID;"
Set r = CurrentDb().OpenRecordset(s, dbOpenDynaset, dbInconsistent)
c = 0
Do Until r.EOF
With r
.Edit
'Calculate each Customer result
!ResultRetailWeek1 = !AvgRetailWeek1 * !Children!RetailWeek1
' * !SalesManagers!RetailWeek1) + Customers!RetailWeek1
'Save and move to the next record.
.Update
.MoveNext
c = c + 1
End With
Loop
r.Close
I know the SELECT statement works, as I've tried it in a query.
My suspicion is that I am not correctly using the syntax to refererence the fields in the other tables, in this line right here:
Code:
!ResultRetailWeek1 = !AvgRetailWeek1 * !Children!RetailWeek1
So, how does one call a field in a SELECT statement when there are two fields of the same name? Basically I'm looking for something like Table1.Field1
Any help?

