I'm trying to get a form to pass a date to the parent Procedure VBA macro in
Outlook, but the procedure can't seem to pick up the variable from the form.
I'm using a public procedure, with the variable declared "dateStart as Date"
(no quotes in the code!), then loading the form and getting the user entry
from the click event as follows:
Private Sub cmdOK_Click()
frmMsgBoxGetDate.Hide
Unload frmMsgBoxGetDate
dateStart = txtdateStart.Value
...a msgBox will display the correct entry in the form sub, but not in the
procedure sub.
Is there something about the Date variable type that is confusing things?
I've tried various combinations of public and private variables, and even
calling a sub within the procedure, but can't seem to bring up this
variable; it just comes up as null or "12:00:00 AM" depending on the
variable type declared in the procedure....
Any clues as to what I'm doing wrong here?
Maybe it's something about the relationship between the form and the module
that I'm ignorant of??
Many thanks,
--
Don Dillinger
Home page: www.geocities.com/Snohomish_Observatory
1. Passing as a parameter calling a Public Sub/Function in a standard
module.
2. Using a Public variable in a Standard module.
3. Property Get/Let
6. Using an initialization file or registry setting.
--
Please post your response to the newsgroup.
http://www.standards.com/ipusers/standards; Word macros, including
converting from WordBasic to VBA; Technical writing and reviewing; Standards
------------------------------------------------
"Don Dillinger" <dill...@foxinternet.com> wrote in message
news:3afce...@news.foxinternet.com...
Call MyProc(txtdateStart.Value)
--
Sue Mosher, Outlook MVP
Author of
Teach Yourself Microsoft Outlook 2000 Programming in 24 Hours
Microsoft Outlook 2000 E-mail and Fax Guide
Outlook and Exchange solutions at http://www.slipstick.com
"Don Dillinger" <dill...@foxinternet.com> wrote in message
news:3afce...@news.foxinternet.com...
I think I've isolated the problem:
Getting the variable to go "public" seemed to require that I put the
procedure in a module separate from the "thisOutlookSession," which for
some reason is where the macro procedure got placed to begin with.
This is probably obvious to the initiated; I don't really understand the
relationships between these items in the object browser. It would seem to
me that a procedure written in "thisOutlookSession" would make variables
available to other code in the same project, if labeled as public...
Sue, does your book cover "restrict method" in any detail?
thanks,
Don
ed setting dateStart as Public (in the
"Sue Mosher" <sue...@slipstick.com> wrote in message
news:udex58t2AHA.1984@tkmsftngp05...
--
Sue Mosher, Outlook MVP
Author of
Teach Yourself Microsoft Outlook 2000 Programming in 24 Hours
Microsoft Outlook 2000 E-mail and Fax Guide
Outlook and Exchange solutions at http://www.slipstick.com
"Don Dillinger" <dill...@foxinternet.com> wrote in message
news:3afdd...@news.foxinternet.com...
-DD
Public "stuff" has to be in a standard module.
--
Please post your response to the newsgroup.
http://www.standards.com/ipusers/standards; Word macros, including
converting from WordBasic to VBA; Technical writing and reviewing; Standards
------------------------------------------------
"Don Dillinger" <dill...@foxinternet.com> wrote in message
news:3afdd...@news.foxinternet.com...