I have a button on my main form that when clicked I want to populate 3 fields on the subform. The weird thing is I have another form that this works perfectly in, I literally copied the code and replaced the form names and the field names.
Anyway I get an error "Access cant find the field 'tbAssigned_WorkOrders_subform' referred to in your expression"
The code that works doesn't have a field on that line, just the form and subform name. I replaced it with my Assigned field just to see but I then get an error saying it cant find the OBJECT 'tbAssigned_WorkOrders_subform'
thoughts?
Anyway I get an error "Access cant find the field 'tbAssigned_WorkOrders_subform' referred to in your expression"
The code that works doesn't have a field on that line, just the form and subform name. I replaced it with my Assigned field just to see but I then get an error saying it cant find the OBJECT 'tbAssigned_WorkOrders_subform'
Code:
Private Sub cmd_AssignOrder_Click()
Set rsc = Forms![tbAssigned_Orders_Form]![tbAssigned_WorkOrders_subform].Form.RecordsetClone 'Errors out here
rsc.MoveFirst ' Because you have ran through the recordset once it ensures that you are starting back at the top.
Do While Not rsc.EOF
If rsc!Assigned = False Then
rsc.Edit
rsc!Assigned = True
rsc!Assigned_User52 = fOSUserName
rsc!Assigned_Date = Date + Time
rsc.Update
End If
rsc.MoveNext
Loop
End Sub
thoughts?