Solved

passing Vaules from one form to another

Posted on 2007-11-23
3
243 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

809 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