Solved

passing Vaules from one form to another

Posted on 2007-11-23
3
240 Views
Last Modified: 2010-08-05
Hi guy,
I have been trying to get his to work for most of the day and i am almost there i think but i can work out this last bit, i am trying to pass data from form1 to form2 and then to form3 i have got it from Form1 to form 2 but can get it to work or form 2, as you can see from the Public sub in the code i have got the objects there and need to pass that data to confirmc then i show that
Public Sub bike(ByVal whichbike As PictureBox, ByVal name As Label, ByVal mid As Label, ByVal photo As PictureBox)
 
 
 

        If whichbike.Tag = "" Then

            'whichbike.Image = images.bookedbike.Image
 

            Who.Show()

        Else

            If whichbike.Tag = "1" Then
 

                confirmc.Show()

            End If

        End If

    End Sub
 

End Module

Open in new window

0
Comment
Question by:awolarczuk
3 Comments
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 500 total points
ID: 20341965
just create some member at each form and copy data to them before calling the form, so you can use as:

confirmc.name = Me.name
confirmc.mid = Me.mid
confirmc.Show()
0
 
LVL 3

Expert Comment

by:Asif_Saadat
ID: 20342108
create sub in confirmc

Public Sub ShowForm(ByVal data As String)
        Me.Show()
End Sub

and call from anywhere with passing data

confirmc.ShowForm("test")
0
 
LVL 3

Expert Comment

by:ScottParker
ID: 20344367
I just add public variables to the top of the form class.
then you can reference them on any form.  something like this...
Public Class Form1
    Public _SQLConnectionString As String
bla bla rest of the stuff on that form..

Then to access that field on another form.. just do..

dim bla as string
bla = Form1._SQLConnectionString
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now