Results 1 to 4 of 4
  1. #1
    George is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Feb 2012
    Posts
    295

    declaring a Global variable


    Good Day all.

    I have a form "Login" with a field "LoginID". When the form is closed I would like to retain the value in "LoginID" to pass to another form "EnterClaims". Apparently the value dies when the form closes.

    I would be grateful for help in retaining the value, if anyone can assist.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    An alternative to closing it is hiding it, so you can refer to it from anywhere. If you want to use a variable, in a standard module

    Public VariableName As DesiredDataType
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    George is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Feb 2012
    Posts
    295
    Thanks Pbaldy. However the property Hide does not appear in the dropdown list. A matter of fact, when I type the form name "Login" is don't even get a dropdown list like you get when an object name is typed.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    You'd set its Visible property to False.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Global Variable
    By gtg430i in forum Programming
    Replies: 11
    Last Post: 03-10-2014, 05:00 PM
  2. Can't See Global Variable
    By CementCarver in forum Programming
    Replies: 12
    Last Post: 09-19-2013, 12:28 PM
  3. How to use global/public variable
    By mrbabji in forum Programming
    Replies: 7
    Last Post: 05-18-2013, 10:08 PM
  4. Declaring a Variable Constant (Sort Of)
    By emmahope206 in forum Programming
    Replies: 1
    Last Post: 02-27-2013, 11:15 AM
  5. Global variable
    By ramdandi in forum Queries
    Replies: 3
    Last Post: 12-18-2011, 01:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums