Results 1 to 4 of 4

Thread: Calling a variable from another form...[Resolved]

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2004
    Posts
    69

    Resolved Calling a variable from another form...[Resolved]

    Ok, I give up...how do you call a variable from another form? It was easier in previous versions to do a globalvar but I can't figure it out. From what i've read in the searches here in the forum it's got something to do with classes and calling something?? Can someone explain to me in simple terms with examples if you can

    i'm using vb.net version 2003

    thanks people

    Kidd
    Last edited by TheKidd554; Jan 28th, 2005 at 08:38 AM.

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Calling a variable from another form...

    search the forum (select the first visual basic.net entry in the forum listing to only search VB.NET forum) and you will find many results as this has been asked many times...

  3. #3
    New Member
    Join Date
    Jan 2005
    Location
    India
    Posts
    1

    Re: Calling a variable from another form...

    respected sir we need coding of datadase connectiviy

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Dec 2004
    Posts
    69

    Re: Calling a variable from another form...

    Ok after searchin for my 3rd day on here I still couldn't find a complete answer so I started to figure it out on my own. Ya I found articles on it but never got a complete answer. Threads seem to go off on a tangent so if anyone reads this, this is how ya do it. Global variable...as alot of peeps say on here 'not good practice' but here goes....
    Create a new class from the 'Project menu'... 'Add class' and call it w/e ya want like 'clsglobal' and declare your variable in there....for me it was...
    VB Code:
    1. Public Share carriername As String

    then call it from where ever by....
    VB Code:
    1. clsglobal.carriername
    from anywhere in the project.

    All the power to ya peeps....

    TheKidd

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width