+ Reply to Thread
Results 1 to 3 of 3

How to use a variant(String) in multiple forms

  1. #1
    Registered User
    Join Date
    07-31-2014
    Location
    Budapest
    MS-Off Ver
    2013
    Posts
    2

    How to use a variant(String) in multiple forms

    Hello, i have a little program with multiple forms, i want to see in every form which user is logged in.
    The problem is i dont know, how can i see from the others forms the username. I tried public xyz as String, but doesnt worked.

    So i want to put the username in variant called loggedin and use that in other forms. The problem is simple, but i am new with vba

    Here is my Login form's code:
    Please Login or Register  to view this content.
    Last edited by neurophunk; 08-14-2014 at 09:50 AM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,419

    Re: How to use a variant(String) in multiple forms

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)


    Declare the public variable in a standard code module rather than the top of the userform code module.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    07-31-2014
    Location
    Budapest
    MS-Off Ver
    2013
    Posts
    2

    Re: How to use a variant(String) in multiple forms

    Oh, it was really simple, thank you for your fast reply!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Getting a mismatch on operator when testing for variant and string
    By BeefNoodleSoup in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-09-2012, 08:59 PM
  2. Replies: 6
    Last Post: 04-06-2012, 04:18 PM
  3. How to compare a variant with a string.
    By Brad4444 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-08-2011, 04:59 PM
  4. DIM Variant / String
    By Helmut in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-09-2006, 08:59 AM
  5. [SOLVED] Retain Variant / String value
    By abc in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-14-2005, 03:05 AM

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1