Help, I am running Access 2003 and have been struggling with this issue for 2 days and cannot get it resolved. I have a DB that tracks Scrapped Parts along with the Countermeasures entered by area supervisors on a weekly basis to work towards eliminating the scrap. I need to be able to update one field in Table1 from Table2 based on user selection to update.
I created the following query to show what I want to update:
The "CarryOver" field is a check box on the form (user request) to indicate what "Countermeasures" the user wants to carry over to Table1 (CMMonth1). If I turn the above into an update query I get an error message "Operation must use an updateable query"
So I tried to use the following Sub:
But it doesn't work either..... Can anyone help me out? I am really really stumped....
I created the following query to show what I want to update:
Code:
SELECT DISTINCT CMGLMonth1.PartNo, CMGLMonth1.Countermeasure, CMGLMonth1.WeekNo, CMGLMonth1.CMYear, CMGLMonth1.CarryOver
FROM CMGLMonth1 INNER JOIN CMMonth1 ON CMGLMonth1.PartNo = CMMonth1.PartNo
WHERE (((CMGLMonth1.WeekNo)=[Forms]![frmMnthCMNew]![WeekNo]) AND ((CMGLMonth1.CMYear)=[Forms]![frmMnthCMNew]![Yr]) AND ((CMGLMonth1.CarryOver)=-1));
The "CarryOver" field is a check box on the form (user request) to indicate what "Countermeasures" the user wants to carry over to Table1 (CMMonth1). If I turn the above into an update query I get an error message "Operation must use an updateable query"
So I tried to use the following Sub:
Code:
Dim strQuery As String
Dim HoldWeekNo As Integer
Dim HoldCMYear As Integer
Dim HoldPartNo As String
Dim Countermeasure As String
HoldWeekNo = Forms!frmMnthCMNew!WeekNo
HoldCMYear = Forms!frmMnthCMNew!Yr
HoldPartNo = Forms!frmMnthCMNew!subfrmCurrCMGLMonth.Form!PartNo
strQuery = "UPDATE CMMonth " & _
"SET Countermeasure = '" & Countermeasure & "'" & _
" WHERE PartNo = '" & HoldPartNo & "'" & _
" AND WeekNo =" & HoldWeekNo & _
" AND CMYear =" & HoldCMYear
CurrentDb.Execute strQuery, dbFailOnError
But it doesn't work either..... Can anyone help me out? I am really really stumped....
