O
Opal
I am running Access 2003. A user enters data into
one field on a continuous form bound to one table. I want to be
able to UPDATE this same data into a similar field in
another table based on an equal week number, year
and Part number for the data. Is this possible?
I have been trying something like:
Sub UpdateCM1()
Dim strQuery As String
Dim HoldWeekNo as Integer
Dim HoldYear as Integer
Dim HoldPartNo as String
HoldWeekNo = Forms!frmMnthCMNew!WeekNo
HoldYear = Forms!frmMnthCMNew!Yr
HoldPartNo = Forms!frmMnthCMNew!PartNo
strQuery = "UPDATE CMMonth " & _
"SET Countermeasure = " ??? & _
" WHERE PartNo = " & HoldPartNo & _
" AND WeekNo = " & HoldWeekNo & _
" AND Year = " & HoldYear &
CurrentDb.Execute strQuery, dbFailOnError
End Sub
I am getting stuck because the form is a
continous form based on a query showing the top 3
part numbers for that week.
I thought of writing the query for the top 3 to a temp
table and then writing everything to a perm table but that
seemed like a lot of work. Can anyone point me in the
right direction?
one field on a continuous form bound to one table. I want to be
able to UPDATE this same data into a similar field in
another table based on an equal week number, year
and Part number for the data. Is this possible?
I have been trying something like:
Sub UpdateCM1()
Dim strQuery As String
Dim HoldWeekNo as Integer
Dim HoldYear as Integer
Dim HoldPartNo as String
HoldWeekNo = Forms!frmMnthCMNew!WeekNo
HoldYear = Forms!frmMnthCMNew!Yr
HoldPartNo = Forms!frmMnthCMNew!PartNo
strQuery = "UPDATE CMMonth " & _
"SET Countermeasure = " ??? & _
" WHERE PartNo = " & HoldPartNo & _
" AND WeekNo = " & HoldWeekNo & _
" AND Year = " & HoldYear &
CurrentDb.Execute strQuery, dbFailOnError
End Sub
I am getting stuck because the form is a
continous form based on a query showing the top 3
part numbers for that week.
I thought of writing the query for the top 3 to a temp
table and then writing everything to a perm table but that
seemed like a lot of work. Can anyone point me in the
right direction?