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

VB.Net-2005 variable transfer from main form to dialog box, 2-nd (not main) project o

VB.Net-2005.
I have two projects in one solution. The problem relates to the second project only.
In the second project I have main form and dialog box.
On main form I have combo box with few selections. I need to read value from that combo box (on main form) to dialog box.
When I set "stop" being in "form load" of dialog box and say: strValue = mainForm.comboBox.SelectedItem the strValue equals to nothing. Why? The focus gets to "form load" event of dialog box, reads statement strValue = ...., jumps to mainForm, returns with "nothing" value.
Note: if I do exactly the same thing being in first (main) project of the solution, everything works fine, i.e. value is delivered, not lost.
Could anyone explain how to get that value of comboBox to dialog box ?
Thank you
Alen Vic.
Jun 29 '15 #1

✓ answered by Seth Schrock

Try setting up a global variable in a module. Set the value of the global variable when the combobox is changed (After Update event). You should then be able to read this variable when your dialog box opens.

2 1404
Seth Schrock
2,965 Expert 2GB
Try setting up a global variable in a module. Set the value of the global variable when the combobox is changed (After Update event). You should then be able to read this variable when your dialog box opens.
Jun 29 '15 #2
Thank you very much Seth.
Jun 30 '15 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: bawar | last post by:
Hellow, I don't seem to be able to send trough the variable 'language' from my form to the php-variable $language that I want to use in my session... I first tried in the form with a drop down...
0
by: source | last post by:
I am trying to create a custom setup project. I know this is very silly, but want to know what is the best way so that when I start my setup I should see a splash form and then my main setup form....
1
by: ssb | last post by:
Hello, One form in my application is the MAIN form. It is set up as "startup" form. However, I need to do the following: (1) When I double click MDE file to launch my project, the MAIN form...
3
by: gsb58 | last post by:
Hi! A mainform is being used to show records from a table in an sql database. A button on the main form will load a new form that allows the user to add, delete, update and search certain...
7
by: Terry | last post by:
I have a Mainform with a Statusbar. When opening another form or doing some processing I want to display info in the Statusbar of the Mainform. I have read a lot of articles on this & have come up...
7
by: Bmack500 | last post by:
I'm using visual studio 2003. I have much of my code in my main form, called 'frmMain'. When I create a class to perform string ops and such, it sometimes needs to refer to functions in the main...
13
by: MLH | last post by:
I have a form, frmVehicleEntryForm. On it is a subform control named frmAddnlOwnrListSubForm. The subform control's source object is frmAddnlOwnrListSubForm. When I click on the subform control,...
3
by: Jon | last post by:
My main form opens up another form, and from this other form, I'd like to access things in the main form. The problem is that although I know the name of the class of the main form (FormMain) I...
3
by: Talnus | last post by:
From an OnChange in VBA in a SUB form I am trying to change a value in the main form. Basically this is to let me know at a quick glance if any of the data has changed on the sub form. Any...
2
twinnyfo
by: twinnyfo | last post by:
Dear Bytes Fans, Here is what my database does: On my standard forms, I have quite a few images that are displayed. They are placed at random locations throughout the forms, and although the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
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...

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.