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

Help with Multiple Forms

I have created 3 forms that are supposed to request information from a Database.

I am able to design the forms, and create the relevant code.

Could someone help me to get the information from Form 2 for example.

From Form 1 i can call up Forms 2 and 3. How do i get the info from Form 1 when i am in Form 2.

I use Visual Basic 2005. ADO.Net

I can give you more infor if you need it

Thanks
Mar 25 '07 #1
6 1420
Dököll
2,364 Expert 2GB
Greetings and salutations, jenkins0706!

Have you tried searching here before hand?

I must admit I do not too much about VB Express. But if you post your code here, skillful, and rather nice specialists here will be able to shed some light.

If you need to search, try adding VB Expess, or VB 2005 to search terms then fire away.

Good luck and welcome!

Dököll
Mar 25 '07 #2
Hi

This is the code for Form2

Public Class Form2
Public ds As New DataSet

Private Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lbxButter.SelectedIndexChanged

End Sub

Private Sub ListBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lbxSummary.SelectedIndexChanged

End Sub

Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmbSpecies.SelectedIndexChanged

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCalc.Click
Dim Perc As Decimal

'lbxRound.Items.Add((txbAddress.Text) & " £ " & CDbl(cmbPrice.Text) * CDbl(txbQty.Text) - CDbl(txbPaid.Text))
Perc = CDec(CInt(CStr(CDbl(txb2005.Text) - CDbl(txb2000.Text))) / (CInt(CStr(CDbl(txb2000.Text))))) * 100

'CInt(txbSpecies.Text.Contains(

lbxButter.Items.Add((txbSpecies.Text) & Perc)
End Sub


End Class

This is the part of the code from Form 1

Private Sub btnForm2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnForm2.Click
Dim frmForm2 As New Form2

frmForm2.Show()
End Sub

I am not able to access the txb2000 and txb2005 from Form1

Help

Thanks
Mar 25 '07 #3
Dököll
2,364 Expert 2GB
If you have done anything in VB 6.0, it's probable you are aware of setting visibility to either True or False. Does VB Express have these methods?

Also try adding

Expand|Select|Wrap|Line Numbers
  1.  
  2. Unload Me
  3. frmForm2.Show
  4.  
  5.  
Should help unload Form1 then show Form2 if this is what you hope to achieve...you'd have to figure out if VB Express also have such a method.
Mar 26 '07 #4
Hi

I am using VB 2005 and i am trying to obtain information from Form1 when i am in Form2.

Any hints

Thanks
Mar 26 '07 #5
ansumansahu
149 100+
Hi

I am using VB 2005 and i am trying to obtain information from Form1 when i am in Form2.

Any hints

Thanks
See if this link helps you out to pass data between forms.

http://www.vbdotnetheaven.com/UploadFile/thiagu304/passdata12262006073406AM/passdata.aspx

thanks
ansuman
Mar 26 '07 #6
Dököll
2,364 Expert 2GB
Hi

I am using VB 2005 and i am trying to obtain information from Form1 when i am in Form2.

Any hints

Thanks
Did you try Unload Me?
Mar 27 '07 #7

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

Similar topics

10
by: Joseph S. | last post by:
Hi, How do I pass a string from one call to a php block to another call in the same page but from another form? Here's my full php code: I'm using two forms in the same page. A hidden field...
2
by: Susan Bricker | last post by:
Greetings. Before I begin, I have been stuck on this problem for about a 5 days, now. I have tried and just seem to be not getting anywhere. I know that the explanation is lengthy, but I am a...
0
by: jon | last post by:
Using Visual C++ and MFC, one could generate a very nice MMI using CFormView and the method detailed in the MSDN "vswap" example to allow multiple forms to be viewed ( switched to ) within a single...
2
by: Joe Rigley | last post by:
Help Please! I've been tasked with converting a portion of the corporate web site that currently utilizes local user accounts and NTFS via Basic Authentication to access certain files on the...
2
by: John Granade | last post by:
I'm looking for the best way to make a dataset available from multiple Windows forms. The dataset is created from an XML file. I have a main form (frmMain) that loads the dataset and reads the...
8
by: darnnews | last post by:
I have a form. When a person selects a publication from a listbox, this snippet of code is supposed to look up authors that correspond to that publication and populate the Author List Box, but...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
6
by: Bob Alston | last post by:
Looking for someone with experience building apps with multiple instances of forms open. I am building an app for a nonprofit organizations case workers. They provide services to the elderly. ...
3
by: tuncgulec | last post by:
Hi all. Thanks for thy reply now. Ive a problem parentlist script. <select size="8" name="parentList" multiple> </select><a href="#stay" onclick = "javascript:small_window('modify.asp');"...
5
by: Neil | last post by:
"lyle" <lyle.fairfield@gmail.comwrote in message news:48c3dde7-07bd-48b8-91c3-e157b703f92b@f3g2000hsg.googlegroups.com... Question for you. I'm doing something similar, only, instead of opening...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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: 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:
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,...

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.