473,770 Members | 4,355 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 "SelectedIndexC hanged", 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 1180
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 DataSourcesAreS et as bool = true;

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

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

If DataSourcesAreS et = 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
3737
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 button bring up a form, and to have which form is brought up determined by which item is selected in the accompanying combo box. I've gathered that you have to declare the item as a
10
4294
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 a item in the list then that item is shown in the combo box.
9
1468
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 the drop down list by typing "c" into the combo box. Then click off from the combo to say a button. Have the button populate a text box with the combo boxes text property. Result = "a" Step 2. Repeat step 1, but type in "b" this time.
0
1603
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 of text and combo boxes on it (in panels on the tab). These combos were originally simple drop down lists - i.e. you had to select from the list and couldn't enter anything of your own. At that time everything worked fine. Now, the users...
1
2575
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 has 4 possible answers to a question. Each of the 4 possible answers is also assigned a value: answer 1 is worth 1 point, answer 2 is worth 2 points.... What I need to do now is add togethor the points of all the combo boxes. So far I have given...
4
2361
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. The idea behind the database is for a user to search/ select desired information in any kind of combination between the 4 combo boxes. Then the user clicks a button (btnSearch) and subsequently a query ("Search Function") is run that shows all 4...
2
7049
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 database I wrote for home, the combo boxes and listboxes no longer display the bound column. For example, on a form I have a combo box based on a table called 'names'. The two columns in the combo box are ID and Surname. The combo box and list box...
2
1215
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 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
4
3116
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 the pc's. The identical application works fine on the other 17 pc's. The O/S is Windows XP Pro service pack 2. There are several combo boxes on a form which allow the user to find records based on the values selected. When the user types a...
0
10237
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9882
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8905
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7431
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6690
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5326
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3987
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3589
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2832
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.