J
Jan Nielsen
Hi
I have a form with a combo on it
The combos items is a list of groups (ie coworker, parent, friend) which it
gets from a dataset when the form loads.
When the user selects a group from the combo my code selects all persons in
this group (using a dataview) and generates an email for them. It all works
well.
Except when I load the form. I have my Dataadapter.Fill placed in the forms
Load procedure.
When I use a Dataadapter.Fill(Dataset that is combos recordsource) the
SelectedIndexChanged of the combo gets invoked.
This calls my SendEmail function (btw with an empty dataview but that is not
really interesting here)
MY PROBLEM:
Is there a way to tell the form that this is initializing so it should skip
the SendEmail function.
I suddenly realized that I have read that the .BeginInit was supposed to do
so so
I tried to move my FillDataAdapter function to right after
InitializeComponent() in the Windows generated code.
And I also tried to place my FillDataAdapter function right before the end
of the Windows Region.
But now my function creates 3 emails (ie the Create email function still
gets called but now the dataview is filled with the records of the first
item.)
Can anyone help?
Best regards
Jan
I have a form with a combo on it
The combos items is a list of groups (ie coworker, parent, friend) which it
gets from a dataset when the form loads.
When the user selects a group from the combo my code selects all persons in
this group (using a dataview) and generates an email for them. It all works
well.
Except when I load the form. I have my Dataadapter.Fill placed in the forms
Load procedure.
When I use a Dataadapter.Fill(Dataset that is combos recordsource) the
SelectedIndexChanged of the combo gets invoked.
This calls my SendEmail function (btw with an empty dataview but that is not
really interesting here)
MY PROBLEM:
Is there a way to tell the form that this is initializing so it should skip
the SendEmail function.
I suddenly realized that I have read that the .BeginInit was supposed to do
so so
I tried to move my FillDataAdapter function to right after
InitializeComponent() in the Windows generated code.
And I also tried to place my FillDataAdapter function right before the end
of the Windows Region.
But now my function creates 3 emails (ie the Create email function still
gets called but now the dataview is filled with the records of the first
item.)
Can anyone help?
Best regards
Jan