473,395 Members | 1,341 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,395 software developers and data experts.

Combo and Text Box issue at App Startup

In my application, I have a Combo Box and Text Box.

At Startup, I fill the Combo Box with information that I allow the Users to
select to do certain Calculations.

My Text Box shows a Value calculated by the information in the Text Box.

At Startup, I have Default information in both boxes.

Right now, a User selects a different line item in the Combo Box... and when
they Select the CALC button, the TEXT box is updated.

What I would like to do is to have the Text Box updated as soon as a User
changes the Combo Box.

But when I do the "SelectedIndexChanged", my Startup Fails as the application
is trying to run this or something.

How do I get around this issue?

Thanks in advance.

BruceF
Jan 6 '08 #1
2 1206
Mr B,

This is a problem with all ListBoxes. It initialize its bindings even before
the Form Load event.

The most simple way for VB Net users is to put a private bool before your
code.
Be aware that you cannot use Option Infer with global members.

private DataSourcesAreSet as bool = true;

In the load form event you set then at the end:
DataSourcesAreSet = true

In your combobox index changes event you place then at the start

If DataSourcesAreSet = False then return

A more elegant solution is to remove the standard created add handler in the
index change event and set that in the load event by using the AddHandler.

Cor

Jan 6 '08 #2
With Deft Fingers, "Cor Ligthert[MVP]" <no************@planet.nlwrote:
>The most simple way for VB Net users is to put a private bool before your
code.
Excellent... that worked!!!
>Be aware that you cannot use Option Infer with global members.
Not a problem for me. It's a pretty simple application.

Thanks again!!!

BruceF
Jan 6 '08 #3

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

Similar topics

1
by: Daniel Hill | last post by:
OK, I have very, VERY basic background knowledge of VB6 and have now upgraded to VB.NET and now I'm struggling to bring up the forms I want. What I am looking to do is to have a click a command...
10
by: Mike L | last post by:
This is for a Win form. Currently, the first record is shown in the combo box. I want the combo box to be blank and when the user clicks on the down arrow to choose from the list and clicks on...
9
by: Mark | last post by:
I am encountering a problem with the combo box. This only happens when using the datasource property, I create a table with the following values (a, b, c, d). Step 1. Select the "c" value from...
0
by: Tom | last post by:
I have some very strange issues with combo boxes on a tab control. Here's the scenario: I have a Windows Forms form that has a tab control on it, with two (2) tabs. Tab 2 happens to have a number...
1
by: Shawn Yates | last post by:
It has been a while since I have done anything on MS Access and I seem to be a bit rusty. I hope someone could help me solve my issue. I have a form that has multiple combo boxes on it. Each box...
3
by: joseph.mccastlain | last post by:
Hello All, I am a new user to Access. I am currently designing a database consisting of four tables for multiple users. Rather than bore you with the goals and such, here is what I am...
4
by: Dave | last post by:
I wasn't sure how to search for previous posts about this, it felt real specific. Ok so here's the database & problem: I have 4 combo boxes: cboServer, cboPolicy, cboDB, and cboApplication. ...
2
by: biganthony via AccessMonster.com | last post by:
Hi, I decided to install Office 2003 Service Pack 3 on my home computer to test (in full knowledge that there may be some issues with it). After installation, I have noticed that with a small...
2
by: Mr. B | last post by:
In my application, I have a Combo Box and Text Box. At Startup, I fill the Combo Box with information that I allow the Users to select to do certain Calculations. My Text Box shows a Value...
4
by: mistyblu | last post by:
I wrote an Access97 application using VBA for a company many moons ago and they have approximately 20 users. All has been hunky dory for a long time but suddenly they have a combo box error on 3 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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.