By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,616 Members | 2,426 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,616 IT Pros & Developers. It's quick & easy.

Help with Multiple Forms

P: 12
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
Share this Question
Share on Google+
6 Replies


Dököll
Expert 100+
P: 2,364
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

P: 12
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
Expert 100+
P: 2,364
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

P: 12
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

100+
P: 149
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
Expert 100+
P: 2,364
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

Post your reply

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