Change form header dynamically

I have a grid application, from which I call and populate a form dynamically. I have 2 different buttons on the grid that call the same form, but I would like the header in the form to show a different header depending on which button is clicked. Any tips?

Create a global variable and modify it depending on the button you click, set that variable as the header of the form… that should do it.

Regards