A general comment: could you please always make sure you share all the details that you can, when you are asking for help. "Does not work" doesn't contain much information. Was there an error? Did you get too many records? Did you get no records? The more you share, the better help you get.
As Martin pointed out in another thread, post_init of the form might be too early in the process, since the query has not yet been executed.
So maybe you could try to hook your code in the post event of executeQuery method of the form data source.