How can I execute code for every record in a subform when an event in a form is trigg

PepeGallo

Registered User.
Local time
Yesterday, 16:31
Joined
May 2, 2008
Messages
14
Hi folks!

How can I execute code for every record in a subform when an event in a form is triggered? Thank you.
 
You will need to enumerate through the Recordset of the Subform.

What exactly are you trying to accomplish?

.
 
I want to check if a condition is true for a particular field in each record of the subform and if it is true update another field in the same record. I want this to happen for every record in the subform but this should be triggered in the current event of the form containing the subform. You are all right, and I actually tried to do that but it didn't work.

This was the code I wrote to accomplish this:

Private Sub Form_Current()
Dim i As Recordset

For Each i In sbFormInvoiceDetails.Form.Recordset
With i
If (Date > sbFormInvoiceDetails.Form!DueBack) Then
sbFormInvoiceDetails.Form!ReturnedStatus = "Overdue"
End If
End With
Next

End Sub

When I execute my main form I got a 3152 error (Operation is not supported for this type of object.)
 

Users who are viewing this thread

Back
Top Bottom