I haven't tried this in IP2007, but I'm sure it is very much like working with IP2003. If you double-click on the Approve/Query button in the designer and then click to Edit Form Code, it should generate an OnClick event handler for this button click. Once this is generated, you should be able to write code into it to handle the click event. The key here is using the event object that is passed in automatically by InfoPath to determine the context of the button.
You should be able to do something like e.Source to determine what node this button was clicked in. Once that node is retrieved you should be able to navigate to whatever else nodes you would like to access.
I hope this helps!
Matt Faus / Microsoft InfoPath MVPQdabra® Software / Streamline data gathering to turn process into knowledge