M
mattc66 via AccessMonster.com
I am trying to us the following code on a control in my main form, on the
Change Event. I want the changes to be applied to all the records in the
related subform. When I test it, nothing happens.
See below code - can anyone help?
Thanks
Matt
Private Sub AR_Matrix_Change()
Dim db As Database
Dim rs1 As Recordset
Dim rs2 As Recordset
Dim sql As String
Dim varReturn As Variant
Set db = CurrentDb
Set rs1 = db.OpenRecordset("select * from tblOrderDetails where QuoteID =
" + CStr(quoteID))
Set rs2 = db.OpenRecordset("select * from tblOrder where QuoteID = " +
CStr(quoteID))
rs1.MoveFirst
While Not rs1.EOF
With rs1
rs1.Edit
rs1.Fields("AR_MATRIX") = rs2.Fields("AR_MATRIX")
rs1.Update
End With
rs1.MoveNext
Wend
Set rs1 = Nothing
Set rs2 = Nothing
End Sub
Change Event. I want the changes to be applied to all the records in the
related subform. When I test it, nothing happens.
See below code - can anyone help?
Thanks
Matt
Private Sub AR_Matrix_Change()
Dim db As Database
Dim rs1 As Recordset
Dim rs2 As Recordset
Dim sql As String
Dim varReturn As Variant
Set db = CurrentDb
Set rs1 = db.OpenRecordset("select * from tblOrderDetails where QuoteID =
" + CStr(quoteID))
Set rs2 = db.OpenRecordset("select * from tblOrder where QuoteID = " +
CStr(quoteID))
rs1.MoveFirst
While Not rs1.EOF
With rs1
rs1.Edit
rs1.Fields("AR_MATRIX") = rs2.Fields("AR_MATRIX")
rs1.Update
End With
rs1.MoveNext
Wend
Set rs1 = Nothing
Set rs2 = Nothing
End Sub