VBA global variable lotus notes issue

Posted on 2009-12-23
Last Modified: 2013-12-18
Hi all,

I have an application that interacts heavily with Lotus Notes (email, databases, etc.) and I need to validate the user's Notes client (id file) password.  I have a userform that initializes when my app starts and a textbox for the password.  I declared the password variable globally because I want to be able to access it as many times as necessary until the app is closed.  The problem seems to be that the variable is destroyed when the form is hidden. Bear in mind, I am not unloading the form, simply hiding it, so I don't know why my variable will not retain the value from the textbox.

Thanks in advance for your help!!
Question by:bfreescott
    LVL 46

    Expert Comment

    by:Sjef Bosman
    This is a VB-form and not a Notes form I hope? The variable is also a VB-variable? It would make it  lot easier for me to reply to your question, for I don't know at all how VB handles variables.

    On the off-chance that you do mean a Notes variable: indeed, there is no such thing as a global variable in Notes. Three ways:
    - a profile document
    - some permanent document
    - environment variables (they are stored in notes.ini)

    Author Comment

    I do mean a VB variable

    Accepted Solution

    I figured this out. I needed to declare the variable in a standard module and then define it in the form code.  After doing that, the variable is globally available for all other session activities.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
    This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
    The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
    This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now