Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

passing Vaules from one form to another

Posted on 2007-11-23
3
Medium Priority
?
259 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 1500 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

688 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