Solved

passing Vaules from one form to another

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

710 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