PC Review


Reply
 
 
Emma Hope
Guest
Posts: n/a
 
      9th Mar 2010
Hi All,

I have a form called frmWeekly on the VBA window for this form, i have a Sub
which sends an email, the code pulls of certain information from the forms
such as receipient txtTo, subject txtSubject etc.

I have a lot of information such as 'Path' information that i use repeatedly
through this code and other subs on this and other forms.

I would like to declare the path as a constant, i have opened a new module
and added: Public Const strPathReports As String =
"Y:\Shared\Tsoi01\TEAMDATA\Onstream Management Information\Reports\Current
Year\Weekly\"

However when i use strPathReports in my code for my sub on the form it comes
back 'empty'.

Why doesn't this work and is there any way around it, other than typing my
constant at the top of every forms code page (Microsoft Office Access Class
Objects) which seems to defeat the object.

Thanks for your help!
Emma





 
Reply With Quote
 
 
 
 
Emma Hope
Guest
Posts: n/a
 
      9th Mar 2010
Never mind...it works! I just can't spell.....oops!
 
Reply With Quote
 
Douglas J. Steele
Guest
Posts: n/a
 
      9th Mar 2010
Glad you got it working, but the fact that it was a spelling problem implies
that you haven't told Access to require that all variables be declared.

The line

Option Explicit

should be at the top of every module.

Once it's there, you'd have got a "Undefined Variable" error, which might
have saved you a fair bit of time.

--
Doug Steele, Microsoft Access MVP
http://www.AccessMVP.com/DJSteele
(no e-mails, please!)

"Emma Hope" <(E-Mail Removed)> wrote in message
news:578D75AB-ACA2-495D-B620-(E-Mail Removed)...
> Never mind...it works! I just can't spell.....oops!



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
xl constants Brettjg Microsoft Excel Programming 4 6th Apr 2009 12:56 PM
Where are on the web the WM constants ?? pamelafluente@libero.it Microsoft VB .NET 12 28th Jan 2006 12:41 AM
Constants Publicjoe Microsoft C# .NET 3 12th Jan 2006 02:56 PM
integer constants used with string constants Eric Newton Microsoft Dot NET Framework 3 14th Jan 2004 05:05 AM
ADO Constants Wayne Wengert Microsoft ADO .NET 1 24th Jul 2003 02:20 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:46 AM.