I am trying to make a button for a form to update all the records it shows from its query with one command button, to avoid having to click on each record and click my "Update" button to auto-fill a field. Basically I have an 'if' statement based on whether a checkbox is Yes/No and if it is checked "Yes" then I want the auto-filled field to update.
Here is my code right now showing what the 'Update' button needs to do, but I don't know how to add to it to make it update ALL the records shown on my continuous form based on whether the 'if' statement is satisfied:
I tried to do a "RunCommand acCmdRecordsGoToNext" command in a loop but it didn't seem to work for me. Any suggestions would be much appreciated!
Here is my code right now showing what the 'Update' button needs to do, but I don't know how to add to it to make it update ALL the records shown on my continuous form based on whether the 'if' statement is satisfied:
Code:
Private Sub Update_Click()
If Me.[Comp_Tag_Same] = -1 Then
Me.[Tag Number] = Me.[Component Number]
End If
End Sub