Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

passing Vaules from one form to another

Posted on 2007-11-23
3
Medium Priority
?
265 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 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

971 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