J
Joan
Hi,
I have a subform where on the AfterUpdate event of a control, I edit the
fields of other fields in the recordset of the subform. These fields however
are not on the subform itself. When I run my form, I get a compile error:
"Method or data memeber not found" on the following line:
.Edit
I cannot figure out why I am getting this on my code. Does anyone have any
ideas? Any help would be so appreciated! Below is my code:
Joan
Private Sub txtStore_AfterUpdate()
Dim db As Database
Dim rs As Recordset
Dim stStore As String
Dim dteRetSaleDate As Date
Dim stInvoice As Long
Dim curRetSalePrice As Currency
Set db = CurrentDb
Set rs = db.OpenRecordset("qryInvoiceSubEdit", dbOpenDynaset)
stStore = Me.Store
stInvoice = Me.InvNum
dteRetSaleDate = Me.dteDateSold
curRetSalePrice = Me.SalesPrice
If Me.Returned <> Null Then
With rs
.Edit
!ReturnedStore = stStore
!ReturnedInvoice = stInvoice
!ReturnedSaleDate = dteRetSaleDate
!ReturnedSalePrice = curRetSalePrice
.Update
End With
End If
End Sub
I have a subform where on the AfterUpdate event of a control, I edit the
fields of other fields in the recordset of the subform. These fields however
are not on the subform itself. When I run my form, I get a compile error:
"Method or data memeber not found" on the following line:
.Edit
I cannot figure out why I am getting this on my code. Does anyone have any
ideas? Any help would be so appreciated! Below is my code:
Joan
Private Sub txtStore_AfterUpdate()
Dim db As Database
Dim rs As Recordset
Dim stStore As String
Dim dteRetSaleDate As Date
Dim stInvoice As Long
Dim curRetSalePrice As Currency
Set db = CurrentDb
Set rs = db.OpenRecordset("qryInvoiceSubEdit", dbOpenDynaset)
stStore = Me.Store
stInvoice = Me.InvNum
dteRetSaleDate = Me.dteDateSold
curRetSalePrice = Me.SalesPrice
If Me.Returned <> Null Then
With rs
.Edit
!ReturnedStore = stStore
!ReturnedInvoice = stInvoice
!ReturnedSaleDate = dteRetSaleDate
!ReturnedSalePrice = curRetSalePrice
.Update
End With
End If
End Sub