Click to See Complete Forum and Search --> : Sequence of Occurence of Change Event
Shella
October 27th, 1999, 12:52 PM
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.
Ravi Kiran
October 28th, 1999, 04:57 AM
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
Shella
October 28th, 1999, 08:12 AM
Hi
The form1 and form2 each contains two DBCombo Boxes with each Bound to a data control. When form1 or form2 is loaded, the Data Control of the form will be activated and cause change event happen to DBCombo1 and DBCombo2, the weird thing is, DBCombo1 change event occurs before DBCombo2 when form1 is loaded.
DBCombo2 change event occurs before DBCombo1 when form2 is loaded. I've tried to think of the factor which may affect the sequence of occurence, still have no idea on that. Then, I deleted the DBCombo1 in form2, and recreate a new DBCombo Box with the same name, DBCombo1, oh the problem solved, DBCombo1 change event now occurs before DBCombo2, means that the sequence of occurence of change event of both controls in form2 is consistent with form1's. Is it confusing to understand ?
I get an idea, the same event of the last created control of the same kind will likely to occur in advance. Anyhow, thanx for ur attention, sincerely
Ravi Kiran
October 29th, 1999, 01:54 AM
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
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.