Well, not exactly an example, but sort of an answer can be found
here. It looks like getting the reference to a form is fairly simple, so going on from there should probably not be too hard.
Another option, if feasible, would be to use macros. There is an example in the example finder of this, but I'm guessing that's not what you want.
Hope this helps.
___________________
Try to take over the world!