Changing a field in all records in a subform

  • Thread starter Thread starter SSJSparky
  • Start date Start date
S

SSJSparky

Guest
Hi guys,

I am currently developing the infamous video rental database a module in my degree. I have hit somewhat of a brick wall, however, in a minor operation.

I have a main form which contains a subform, the subform contains a checkbox field called itemWithdrawn. My problem is that I want to have a button on the main form which, when clicked sets the itemWithdrawn field to Yes for all the records in the subform in one go.

I would be really greatful if anyone would be able to tell me how to do this.

Many Thanks in advance.
 
Private Sub Button1_Click()

DoCmd.RunSql "Update YourTableForSubformName Set itemWithdrawn=True"

End Sub


Then Refresh Your subform.
 

Users who are viewing this thread

Back
Top Bottom