I've heard that you can't get access in the vb code to any of the fields in an OpenQuery and that you have to do a DLookup. Yet here in some production code I found that the field [annualizedcharges] is being stuffed back into an update table. When I use "msg [annualizedcharges] the program just hangs as though it doesn't recognize the syntax.
Is the annualizedcharges field that was part of the qryA resultset available in the code and if so how?
DoCmd.OpenQuery "qryA"
strSQL = "UPDATE (tblFacultyBudgetHeader " & _
"INNER JOIN tblAnnualizedCharges ON tblFacultyBudgetHeader.FacultySSN = tblAnnualizedCharges.SSN) " & _
"INNER JOIN tblFacultyBudgetDetail ON tblFacultyBudgetHeader.BudgetNumber = tblFacultyBudgetDetail.BudgetNumber " & _
"SET " & strFieldName & "= [annualizedcharges] " & _
"WHERE (((tblFacultyBudgetDetail.AccountTypeCode)='PS-GC'))"
Is the annualizedcharges field that was part of the qryA resultset available in the code and if so how?
DoCmd.OpenQuery "qryA"
strSQL = "UPDATE (tblFacultyBudgetHeader " & _
"INNER JOIN tblAnnualizedCharges ON tblFacultyBudgetHeader.FacultySSN = tblAnnualizedCharges.SSN) " & _
"INNER JOIN tblFacultyBudgetDetail ON tblFacultyBudgetHeader.BudgetNumber = tblFacultyBudgetDetail.BudgetNumber " & _
"SET " & strFieldName & "= [annualizedcharges] " & _
"WHERE (((tblFacultyBudgetDetail.AccountTypeCode)='PS-GC'))"