What I need is a snippet of code (using MS Acess) that will allow me to update one recordset based on another ... here is what i have so far
IDNumbMDRs = Replace(IDNumbs, "US", "00")
rsSQL.Open "select PersonnelNbr, PrimarySectorCode, SecondarySectorCode,PrimaryFocusCode from Employee " & vbCrLf & _
"where PersonnelNbr IN(" & IDNumbMDRs & ") ", con
IDNumbsAsString = Replace(IDNumbs, " ", "")
IDNumbsAsString = "'" & Replace(IDNumbsAsString, ",", "','") & "'"
Set rsEmp = DataDB.OpenRecordset("select EmpID, IndustryID,PayrollKey, IndSegmentID from Employees where PayrollKey in (" & _
IDNumbsAsString & ")")
Set rsFocus = CurrentDb.OpenRecordset("select Long1, Long2, Int1 from ParameterValues where PName = 'USFo' order by Long1, Long2")
ok so the first recordset will bringback personnel number and primaryfocuscode
the second will allow me to match the personnelnumber and the payrollkey the record i want to update is in the second recordset so now if the personnel number and the payrollkey match ... then i would like to look at the PrimaryfocusCode and match that to the third recordset and if they match then update rsSQL!MajorTypeID with rsFocus!Long2.
Any help would be appreciated.
IDNumbMDRs = Replace(IDNumbs, "US", "00")
rsSQL.Open "select PersonnelNbr, PrimarySectorCode, SecondarySectorCode,PrimaryFocusCode from Employee " & vbCrLf & _
"where PersonnelNbr IN(" & IDNumbMDRs & ") ", con
IDNumbsAsString = Replace(IDNumbs, " ", "")
IDNumbsAsString = "'" & Replace(IDNumbsAsString, ",", "','") & "'"
Set rsEmp = DataDB.OpenRecordset("select EmpID, IndustryID,PayrollKey, IndSegmentID from Employees where PayrollKey in (" & _
IDNumbsAsString & ")")
Set rsFocus = CurrentDb.OpenRecordset("select Long1, Long2, Int1 from ParameterValues where PName = 'USFo' order by Long1, Long2")
ok so the first recordset will bringback personnel number and primaryfocuscode
the second will allow me to match the personnelnumber and the payrollkey the record i want to update is in the second recordset so now if the personnel number and the payrollkey match ... then i would like to look at the PrimaryfocusCode and match that to the third recordset and if they match then update rsSQL!MajorTypeID with rsFocus!Long2.
Any help would be appreciated.