Subject Re: [IBO] Re: Refreshing parameterised IB_Query when params change
Author Lester Caine
> Well, probably my english is not very good, but I'm sure that if you
> carefully read my first and second post, you find that IS the problem,
> i.e. BeforeOpen is fired when you .Refresh ONLY if "RefreshAction" is
> set to raOpen ;)

Personally that is what I would expect. The BeforeOpen
trigger will only be fired WHEN the query changes from
'NotOpen' to 'Open' state. I do not want it to fire when the
query is already open, as is the case if the RefreshAction
is set to maintain it open.

> I've noted following other lists with a news reader, that sometimes
> seems that the server messes up messages thread, so you could have
> miss it and I copy it here for your convenience:
>
> "Well, refresh does open the query if you set "RefreshAction" to
> raOpen, but this does not solve complitely the problem, since I often
> user refresh for "refreshing" the grid content, and I need
> raKeepDataPos, and when some conditions change (i.e. fiscal year) I
> need to "refresh" the dataset in the way the new parameters are taken
> in the query."

In this situation the query will always be open, so that
BeforeOpen will not ( and should not ) fire. So you need to
look at what you are doing - I have open master, detail and
sub-detail, using ParamByName and do not have any problem
with everthing refreshing when the user makes a change.

So as has been said - what are you trying to do?

The 'BeforeOpen' event should be used to set things like
database name, user settings and the like - once it has been
prepared and is in use, then you should be able to change
the parameters and refresh whenever you like. ( As I
understand things )

--
Lester Caine
-----------------------------
L.S.Caine Electronic Services