T
Tony Girgenti
When i execute the following select, using Access XP, VBA, DAO, external
tables and try to print the following line using "Debug.Print", I get "Error
3265(Item not found in this collection)" on sa_lin.item_no. I tried doing
"Cusrs!sa_lin.item_no", "Cusrs!sa_lin!item_no", "Cusrs.sa_lin.item_no" and
several other variations. Any help that any body can provide would be
greatly appreciated. Thanks, Tony
CusQry = "SELECT DISTINCT cust.*, sa_lin.item_no " & _
"FROM (cust " & _
"INNER JOIN sa_hdr " & _
"ON cust.nbr = sa_hdr.cust_no) " & _
"INNER JOIN sa_lin " & _
"ON sa_hdr.ticket_no = sa_lin.hdr_ticket_no " & _
"WHERE sa_lin.item_no BETWEEN '" & StartItem & "' AND '" &
EndItem & "' " & _
"AND sa_hdr.post_dat BETWEEN '" & StartDate & "' AND '" &
EndDate & "' " & _
"AND cust.zip_cod BETWEEN '" & StartZipCode & "' AND '" &
EndZipCode & "' " & _
"AND (cust.cat = '" & CustCat & "' OR '" & CustCat & "' = '"
& Hex(0) & "');"
Set Cusrs = dbs.OpenRecordset(CusQry, dbOpenSnapshot)
If (Cusrs.RecordCount = 0) Then
CustQuery = 0
End If
Debug.Print "rec = " & Cusrs!NBR & " Line = " & Cusrs![sa_lin.item_no]
tables and try to print the following line using "Debug.Print", I get "Error
3265(Item not found in this collection)" on sa_lin.item_no. I tried doing
"Cusrs!sa_lin.item_no", "Cusrs!sa_lin!item_no", "Cusrs.sa_lin.item_no" and
several other variations. Any help that any body can provide would be
greatly appreciated. Thanks, Tony
CusQry = "SELECT DISTINCT cust.*, sa_lin.item_no " & _
"FROM (cust " & _
"INNER JOIN sa_hdr " & _
"ON cust.nbr = sa_hdr.cust_no) " & _
"INNER JOIN sa_lin " & _
"ON sa_hdr.ticket_no = sa_lin.hdr_ticket_no " & _
"WHERE sa_lin.item_no BETWEEN '" & StartItem & "' AND '" &
EndItem & "' " & _
"AND sa_hdr.post_dat BETWEEN '" & StartDate & "' AND '" &
EndDate & "' " & _
"AND cust.zip_cod BETWEEN '" & StartZipCode & "' AND '" &
EndZipCode & "' " & _
"AND (cust.cat = '" & CustCat & "' OR '" & CustCat & "' = '"
& Hex(0) & "');"
Set Cusrs = dbs.OpenRecordset(CusQry, dbOpenSnapshot)
If (Cusrs.RecordCount = 0) Then
CustQuery = 0
End If
Debug.Print "rec = " & Cusrs!NBR & " Line = " & Cusrs![sa_lin.item_no]