A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Global variables that stick around



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old February 9th 11, 09:27 PM
Basstwo Basstwo is offline
Junior Member
 
First recorded activity at Outlookbanter: Feb 2011
Posts: 1
Question Global variables that stick around

I am familiar with declaring global variable in a module from Excel. But when I try to do the same thing in Outlook they lose their value.

This is in a module:
Public EndLINXDate As Date


This is the code for my form:
Private Sub UserForm_Initialize()
LINXDateBox.Value = Format(GV.EndLINXDate, "mm/dd/yyyy")
End Sub

Private Sub LINXDateOKB_Click()
On Error Resume Next
Err.Clear
GV.EndLINXDate = Format(LINXDateBox.Value, "mm/dd/yyyy")
If Err.Number 0 Then
LINXDateBox.Value = ""
Else
Unload Me
End If
End Sub


I can store a value and see it when I bring the form up again. But if I close and re-open Outlook the variable has lost its value.

How can I fix this?

Erik
Ads
 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Global Variables/Session Variables dch3 Outlook and VBA 2 May 31st 07 02:11 PM
variables? sensible Outlook Express 2 October 16th 06 03:34 AM
Accessing add-in's global variables [email protected] Add-ins for Outlook 4 September 24th 06 07:28 AM
Sessions and Variables Ian Mackenzie Outlook and VBA 1 March 9th 06 03:35 PM


All times are GMT +1. The time now is 04:33 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.