Update records in subform on click (1 Viewer)

Lukn4it

New member
Local time
Today, 12:32
Joined
Dec 14, 2007
Messages
4
I have a form that contains a subform. I want to make a button that on click updates all the records listed in the subform.

This is the best I came up with. Can anyone help me get a little closer to a solution?

Dim rs As DAO.Recordset
Set rs = Me.SubList_for_Billing_Center_Form.Form.RecordsetClone
With rs
.MoveFirst
Do While Not .EOF
.Edit
UPDATE Billing SET Billing.Billing_Declined = True, Billing.Billing_Declined_Date = Date()
WHERE (((Billing.Billing_Declined) Not Like True) AND ((Billing.EmployeeID_Billing) Is Null Or (Billing.EmployeeID_Billing)="") AND ((Billing.Do_Not_Bill) Not Like True) AND ((Billing.OrderID)=[Forms]![Billing_Center_Form]![SubList_for_Billing_Center_Form].[Form]![Orderid]));
.Update
.MoveNext
Loop
End With
Set rs = Nothing
 

vbaInet

AWF VIP
Local time
Today, 16:32
Joined
Jan 22, 2010
Messages
26,374
Save that as an UPDATE query and run the query itself using CurrentDb.Execute()
 

Users who are viewing this thread

Top Bottom