Sequence of Occurence of Change Event
Hi
I have created two forms both containing most of the same controls and codes. For example, form1 and form2 each has two DBCombo Boxes bound to a Data Control respectively. The question is, the change event of DBCombo1 occurs before DBCombo2 when form1 is loaded. However, the change event of DBCombo2 occurs before DBCombo1 when form2 is loaded. As these two forms share the same codes, what factor causes the sequence of ocurrence to be different on both forms ? Can I manually rearrange the sequence of occurence of change event for both DBCombo1 and DBCombo2 ? Really Need your help in a hurry. Thanks a lot.
Re: Sequence of Occurence of Change Event
I Just tested with a simple project with ( what i thought was) your config, and with Debug prints and loaded both forms. Atleast in simple /sample runs, i dont get any debug prints in _change events!. on form load.. I tried all possible combinations but was not able to produce this behaviour. so i guess it is very different
So now.. why should a change event in a DBCombo trigger in Form load? - The only reason i can think of is if you are trying to set the "default/startup" values. If that is the case then you could be setting them in different order in both the forms. Check that
Or post some code.
RK
Re: They are bound control
Yeah. I also tried with a BOUND control only. Who ever user a DB combo in unbound mode.. one could as well use a ordinary combo, right?! I felt lazy to describe in my prev. post.:
There as 2 forms. and each of them contained a data control and 2DBCombos (DBC). and they we all bound at design time, to same DB and record source too. I made sure that that the tab order ( control creation) was not same, for i suspected that could be the reason ( but the result was negative. i couldnt trigger it). And the lists in the DBCs were connected to different fields ofcourse. I tried with DBC style 0 and 2 also. But still nothing happend! The lists and the texts were showing the current record vals, and would change when i click the data control.
Yet another of those quircks of VB?!
As an Aside: in Loops like For Each the control creation order matters.. i had noticed.
RK