473,398 Members | 2,403 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Form and Combo Initialize problem...

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
Nov 20 '05 #1
3 1351
Cor
Hi Jan,

I hate it to use switches, but for that Combo box I have to use them. I
have again took a very long time to overcome it. I could eliminate it
(although the way I do it is a normal switch method, because I test of the
first table in the dataset exist).

Be aware that the Combobox is famous because his bugs, I don't know if your
problem is one of them. Most bugs about which people start tell here are
mostly no bugs, but in the case of the combobox be awared.

Cor
Nov 20 '05 #2
Hi again Cor
I would like to avoid workarounds until I am quite sure there is no "right"
way of doing it.
And I think my problem is more than a combo problem.

I would like the events of _all_ a forms controls to be suspended when the
form is initialized. It could be listboxes, textboxes etc. IE if you add a
Private Sub txtFornavn_TextChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles txtFornavn.TextChanged
MsgBox("test")
End Sub
To a form and txtforavn is databound, TextChanged is invoked when the form
is drawn the first time.

Right now I have made a boolean that checks if it is first time, but this is
a workaround.
I hoped for a better way.

Best regards

Jan



"Cor" <no*@non.com> skrev i en meddelelse
news:3f***********************@reader20.wxs.nl...
Hi Jan,

I hate it to use switches, but for that Combo box I have to use them. I
have again took a very long time to overcome it. I could eliminate it
(although the way I do it is a normal switch method, because I test of the
first table in the dataset exist).

Be aware that the Combobox is famous because his bugs, I don't know if your problem is one of them. Most bugs about which people start tell here are
mostly no bugs, but in the case of the combobox be awared.

Cor

Nov 20 '05 #3
I just stumbled over the combo_SelectionChangeCommitted event.
This event is not triggered when a combo is filled.
I haven't tested it thoroughly but it seems to work allright.

Jan

"Jan Nielsen" <Re**************@tiscali.dk> skrev i en meddelelse
news:uW*************@TK2MSFTNGP10.phx.gbl...
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

Nov 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Neil | last post by:
I have a very puzzling situation with a database. It's an Access 2000 mdb with a SQL 7 back end, with forms bound using ODBC linked tables. At our remote location (accessed via a T1 line) the time...
4
by: Skully Matjas | last post by:
I am using the following code (created by the wizard) to allow to bring my form to a particular entery. But when I edit the entery (ex: put new information into a blank cell), it puts that record...
5
by: will eichert | last post by:
Greetings. I have a problem with a combo box incorrectly displaying blank items when returning to a form from a modal form. It's fine when the main form first comes up, but gets messed up when the...
2
by: misschristalee | last post by:
I'm having a brain blockage day.... Scenario: Search Form with 6 text boxes Query has same six fields Each has this IIF: IIf(IsNull(!!),"",!!) with each dictating the correct text box of...
8
by: Zlatko Matić | last post by:
There is a form (single form) and a combobox. I want that current record of the form is adjusted according to selected value in the combobox. Cuurrent record should be the same as the value in the...
14
by: alwayshouston | last post by:
Hi All! I am working on this very small database and I am confused in the designing a simple form. I only have three tables in the database. First Table: tblExpense Columns: ExpenseID ;...
1
by: Robert | last post by:
Every thing worked fine until all of a sudden, I get the following error whenever I try to do anything on one of my forms that calls an Event Procedure. I get the error as soon as the form opens...
7
by: Rotsey | last post by:
Hi, I am loading a tab control on a form. The code loads textboxes and comboboxes and checkboxes, normal data entry form that loads a table row of data. I have a combo on the form above the...
3
by: Salad | last post by:
Using A97, SP2, most current jet35. I have a search form. The op enters an id to search/find. If found, a data entry form is presented for that id. This form has 7 or 8 combos, a bunch of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.